/* ============================================
   HOME BARBERSHOP - Main Stylesheet
   Theme: Slate/Dark (from reference design)
   Mobile-first responsive design
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Manrope', sans-serif;
  background: #f3f4f6;
  color: #0f172a;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   UTILITIES
   ============================================ */
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.page-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  font-style: italic;
}
.section-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.error-text { color: #ef4444; font-size: 0.875rem; margin-top: 8px; font-weight: 600; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0f172a;
  color: #fff;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25); }
.btn-primary:active { transform: scale(0.95); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f1f5f9;
  color: #64748b;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}
.btn-secondary:hover { background: #e2e8f0; color: #0f172a; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ef4444;
  color: #fff;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #10b981;
  color: #fff;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.7rem;
  border-radius: 12px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.65rem;
  border-radius: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #64748b;
  transition: all 0.2s;
}
.icon-btn:hover { background: #f1f5f9; color: #0f172a; }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.pro-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 16px;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  outline: none;
}
.pro-input:focus { background: #fff; border-color: #0f172a; box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1); }
.pro-input::placeholder { color: #94a3b8; font-weight: 400; }

select.pro-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }

textarea.pro-input { resize: vertical; min-height: 80px; border-radius: 16px; }

/* Toggle Switch */
.toggle { position: relative; display: inline-flex; width: 48px; height: 28px; cursor: pointer; }
.toggle input { display: none; }
.toggle-slider {
  width: 100%; height: 100%;
  background: #cbd5e1;
  border-radius: 14px;
  transition: all 0.3s;
  position: relative;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.toggle input:checked + .toggle-slider { background: #10b981; }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Payment Toggle */
.payment-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 14px;
}
.payment-toggle-btn {
  padding: 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  transition: all 0.2s;
  color: #64748b;
}
.payment-toggle-btn.active { background: #fff; color: #0f172a; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ============================================
   CARDS
   ============================================ */
.pro-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
}
.pro-card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); border-color: #cbd5e1; }
.pro-card-dark {
  background: #0f172a;
  border: none;
  border-radius: 24px;
  padding: 20px;
  color: #fff;
}

/* Stat Card */
.stat-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 2rem;
  padding: 24px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  min-width: 0;
}
.stat-card .stat-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stat-card .stat-value {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
  color: #0f172a;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-card.income .stat-value { color: #10b981; }
.stat-card.expense .stat-value { color: #ef4444; }
.stat-card.dark {
  background: #0f172a;
  border: none;
  color: #fff;
}
.stat-card.dark .stat-label { color: #94a3b8; }
.stat-card.dark .stat-value { color: #fff; }

/* ============================================
   TABLES
   ============================================ */
.pro-table-wrapper {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}
.pro-table { width: 100%; border-collapse: collapse; }
.pro-table thead { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.pro-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.pro-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 0.875rem; }
.pro-table tbody tr { transition: all 0.2s; }
.pro-table tbody tr:hover { background: #f8fafc; }
.pro-table tbody tr:last-child td { border-bottom: none; }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0e7ff; color: #3730a3; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-cash { background: #d1fae5; color: #065f46; }
.badge-transfer { background: #e0e7ff; color: #3730a3; }

/* ============================================
   LOGIN PAGE
   ============================================ */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  padding: 24px;
  position: relative;
  z-index: 1;
}
#login-page.active { display: flex; }
.login-container { width: 100%; max-width: 400px; }
.login-card {
  background: #fff;
  padding: 40px;
  border-radius: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border: 1px solid #f1f5f9;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-img {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border: 4px solid #fff;
}
.login-logo h1 {
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-style: italic;
  margin-bottom: 4px;
}
.login-logo p {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.login-form { }
.login-form label {
  display: block;
  font-size: 10px;
  font-weight: 900;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  margin-left: 4px;
}
.login-input-wrap {
  position: relative;
}
.login-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #cbd5e1;
  display: flex;
  pointer-events: none;
  transition: color 0.2s;
}
.login-input-wrap:focus-within .login-input-icon { color: #0f172a; }
.login-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 16px 16px 48px;
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}
.login-input:focus {
  background: #fff;
  border-color: #0f172a;
  box-shadow: 0 0 0 4px #f1f5f9;
}
.login-input::placeholder { color: #cbd5e1; font-weight: 400; }
.login-error {
  padding: 10px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  border-radius: 12px;
  border: 1px solid #fee2e2;
  text-align: center;
  margin-bottom: 16px;
}
.login-btn {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 20px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15);
}
.login-btn:hover { background: #000; }
.login-btn:active { transform: scale(0.95); }
.login-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ============================================
   SIDEBAR (Desktop)
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 256px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: -0.025em;
  border-bottom: 1px solid #f1f5f9;
}
.logo-icon-sm {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  transition: all 0.2s;
}
.nav-item:hover { background: #f8fafc; color: #0f172a; }
.nav-item.active { background: #0f172a; color: #fff; box-shadow: 0 10px 15px -3px rgba(15,23,42,0.15); }
.nav-item svg { flex-shrink: 0; }
.sidebar-footer { padding: 12px; border-top: 1px solid #f1f5f9; }

/* ============================================
   MOBILE HEADER
   ============================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}
.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon-xs {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
}
.mobile-title { font-weight: 800; font-size: 0.8rem; letter-spacing: 0.05em; }
.mobile-header-right { display: flex; align-items: center; gap: 8px; }
.role-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
}

/* ============================================
   SHOP SELECTOR
   ============================================ */
.shop-selector {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 20px;
  z-index: 40;
  margin-left: 256px;
}
.shop-select { max-width: 300px; padding: 8px 16px; border-radius: 12px; font-size: 0.8rem; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-left: 256px;
  padding: 24px;
  min-height: 100vh;
}
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease-out; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ============================================
   BOTTOM NAV (Mobile)
   ============================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 12px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  transition: all 0.2s;
}
.bottom-nav-item.active { color: #0f172a; }
.bottom-nav-item.active svg { stroke-width: 3; }

.bottom-nav-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #0f172a;
  color: #fff;
  border-radius: 50%;
  margin-top: -32px;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.3);
  transition: all 0.2s;
  border: 4px solid #fff;
}
.bottom-nav-fab:active { transform: scale(0.9); }

/* ============================================
   MORE MENU (Mobile)
   ============================================ */
.more-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.more-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}
.more-menu-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 2rem 2rem 0 0;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 -25px 50px -12px rgba(0, 0, 0, 0.15);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.more-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-weight: 900;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-style: italic;
}
.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.more-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  transition: all 0.2s;
}
.more-menu-item:active { transform: scale(0.95); }
.more-menu-item svg {
  width: 56px;
  height: 56px;
  padding: 16px;
  border-radius: 16px;
  color: #fff;
  background: #64748b;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.more-menu-item.danger { color: #ef4444; }
.more-menu-item.danger svg { background: #ef4444; color: #fff; }
/* Colored icon badges per section */
.more-menu-item[data-page="finances"] svg { background: #14b8a6; }
.more-menu-item[data-page="services"] svg { background: #f43f5e; }
.more-menu-item[data-page="products"] svg { background: #f97316; }
.more-menu-item[data-page="staff"] svg { background: #8b5cf6; }
.more-menu-item[data-page="commissions"] svg { background: #ec4899; }
.more-menu-item[data-page="payroll"] svg { background: #16a34a; }
.more-menu-item[data-page="shops"] svg { background: #f59e0b; }
.more-menu-item[data-page="activity"] svg { background: #334155; }
.more-menu-item[data-page="settings"] svg { background: #64748b; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-container {
  background: #fff;
  border-radius: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: -0.01em;
}
.modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.modal-full {
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 200;
  animation: fadeIn 0.3s ease-out;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.toast.success { background: #0f172a; color: #fff; }
.toast.error { background: #ef4444; color: #fff; }
.toast.warning { background: #f59e0b; color: #fff; }

/* ============================================
   POS / NEW ORDER PAGE
   ============================================ */
.pos-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.pos-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.pos-item-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.pos-item-card:hover { border-color: #94a3b8; }
.pos-item-card.selected { background: #0f172a; border-color: #0f172a; color: #fff; }
.pos-item-card .item-name { font-weight: 700; font-size: 0.8rem; margin-bottom: 4px; }
.pos-item-card .item-price { font-weight: 800; font-size: 0.9rem; }
.pos-item-card.selected .item-price { color: #94a3b8; }
.pos-item-card .item-stock { font-size: 0.7rem; color: #94a3b8; margin-top: 2px; }
.pos-item-card.out-of-stock { opacity: 0.4; pointer-events: none; }

/* Collapsible item groups */
.pos-group { border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.pos-group.has-selected { border-color: #0f172a; }
.pos-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer; user-select: none;
  background: #f8fafc; transition: background 0.15s;
}
.pos-group-header:hover { background: #f1f5f9; }
.pos-group-info { display: flex; flex-direction: column; gap: 2px; }
.pos-group-name { font-weight: 700; font-size: 0.85rem; color: #334155; }
.pos-group-count { font-size: 0.75rem; color: #94a3b8; }
.pos-group-count strong { color: #0f172a; }
.pos-group-arrow { transition: transform 0.2s; color: #94a3b8; flex-shrink: 0; }
.pos-group.open .pos-group-arrow { transform: rotate(180deg); }
.pos-group-body { display: none; padding: 10px 12px 12px; }
.pos-group.open .pos-group-body { display: block; }

/* Desktop order form layout */
.new-order-form { max-width: 640px; margin: 0 auto; }

.pos-summary {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 20px;
  position: sticky;
  top: 20px;
}
.pos-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.875rem;
}
.pos-summary-total {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 2px solid #0f172a;
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 800;
}
.pos-selected-items { margin: 12px 0; }
.pos-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
}
.pos-selected-item:last-child { border-bottom: none; }

/* Tab toggle for services/products */
.tab-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.tab-toggle-btn {
  padding: 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  transition: all 0.2s;
  color: #64748b;
}
.tab-toggle-btn.active { background: #fff; color: #0f172a; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* Category pills */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.category-pill {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: #f1f5f9;
  color: #64748b;
  transition: all 0.2s;
}
.category-pill.active { background: #0f172a; color: #fff; }

/* ============================================
   ORDER HISTORY
   ============================================ */
.order-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.order-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.order-customer {
  display: flex;
  align-items: center;
  gap: 10px;
}
.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #64748b;
}
.order-items-list {
  font-size: 0.8rem;
  color: #64748b;
  margin: 8px 0;
}
.order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}
.order-amount { font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.order-actions { display: flex; gap: 6px; }

/* ============================================
   CUSTOMER CARDS
   ============================================ */
.customer-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.customer-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.customer-info { display: flex; align-items: center; gap: 12px; }
.customer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.customer-stat {
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 12px;
}
.customer-stat .label { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.customer-stat .value { font-weight: 800; font-size: 0.9rem; margin-top: 2px; }

/* ============================================
   STAFF CARD
   ============================================ */
.staff-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  transition: all 0.2s;
}
.staff-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.staff-card.inactive { opacity: 0.5; }
.staff-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.staff-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}
.staff-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ============================================
   FINANCE PAGE
   ============================================ */
.finance-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.transaction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.transaction-row:last-child { border-bottom: none; }
.txn-amount.income { color: #10b981; font-weight: 800; }
.txn-amount.expense { color: #ef4444; font-weight: 800; }

/* ============================================
   COMMISSION PAGE
   ============================================ */
.commission-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.commission-list { display: flex; flex-direction: column; gap: 8px; }
.commission-table-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.commission-table-card.active { border-color: #0f172a; background: #0f172a; color: #fff; }
.commission-rate-row {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.commission-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}
.commission-type-btn {
  padding: 6px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  transition: all 0.2s;
}
.commission-type-btn.active { background: #0f172a; color: #fff; }

/* ============================================
   CHARTS
   ============================================ */
.chart-container {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 2.5rem;
  padding: 32px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}
.chart-bar-wrapper { display: flex; flex-direction: column; gap: 10px; }
.chart-bar-item { display: flex; align-items: center; gap: 12px; }
.chart-bar-label { width: 100px; font-size: 0.8rem; font-weight: 600; color: #475569; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar-track { flex: 1; height: 28px; background: #f1f5f9; border-radius: 8px; overflow: hidden; position: relative; }
.chart-bar-fill { height: 100%; background: #0f172a; border-radius: 8px; transition: width 0.6s ease; min-width: 2px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.chart-bar-value { font-size: 0.7rem; font-weight: 800; color: #fff; white-space: nowrap; }
.chart-bar-value-outside { font-size: 0.75rem; font-weight: 700; color: #475569; margin-left: 8px; white-space: nowrap; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}
.empty-state p { font-size: 0.875rem; font-weight: 600; font-style: italic; }

/* Loading */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 16px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filter-bar .pro-input { max-width: 200px; padding: 8px 14px; font-size: 0.8rem; border-radius: 12px; }
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.search-input-wrap .pro-input { padding-left: 40px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 72px;
    padding-bottom: 80px;
  }
  .shop-selector { margin-left: 0; padding: 8px 16px; position: fixed; top: 56px; left: 0; right: 0; z-index: 40; }
  .main-content.has-shop-selector { padding-top: 120px; }

  .page-title { font-size: 1.25rem; }
  .pro-card { border-radius: 20px; padding: 16px; }
  .stat-card { padding: 14px; border-radius: 18px; }
  .stat-card .stat-value { font-size: 1.15rem; }

  .pos-layout { grid-template-columns: 1fr; }
  .pos-summary { position: fixed; bottom: 64px; left: 0; right: 0; border-radius: 24px 24px 0 0; z-index: 30; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); padding-bottom: 16px; }
  .pos-items-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }

  .commission-layout { grid-template-columns: 1fr; }
  .filter-bar .pro-input { max-width: 100%; }
  .search-input-wrap { min-width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .finance-stats { grid-template-columns: 1fr 1fr; }

  .modal-container { border-radius: 24px 24px 0 0; position: absolute; bottom: 0; max-height: 95vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .pro-table-wrapper { border-radius: 16px; }
  .pro-table th, .pro-table td { padding: 10px 12px; font-size: 0.8rem; }

  .toast { top: auto; bottom: 80px; right: 16px; left: 16px; text-align: center; }
}

@media (min-width: 769px) {
  .mobile-header { display: none !important; }
  .bottom-nav { display: none !important; }
  .more-menu { display: none !important; }
}

@media (min-width: 1024px) {
  .pos-layout { grid-template-columns: 2fr 1fr; }
  .new-order-form { max-width: 960px; display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
  .new-order-summary { position: sticky; top: 80px; }
}

/* ============================================
   CONFIRMATION DIALOG
   ============================================ */
.confirm-dialog {
  text-align: center;
  padding: 20px 0;
}
.confirm-dialog p { font-size: 0.95rem; color: #475569; margin-bottom: 24px; line-height: 1.6; }
.confirm-dialog .btn-group { display: flex; gap: 12px; justify-content: center; }

/* ============================================
   AUTOCOMPLETE
   ============================================ */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  margin-top: 4px;
}
.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.875rem;
}
.autocomplete-item:hover { background: #f8fafc; }
.autocomplete-item .name { font-weight: 700; }
.autocomplete-item .detail { font-size: 0.75rem; color: #94a3b8; }

/* ============================================
   PAYROLL
   ============================================ */
.payroll-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
}
.payroll-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.875rem;
}
.payroll-row .label { color: #64748b; }
.payroll-row .value { font-weight: 700; }
.payroll-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 2px solid #0f172a;
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 800;
}

/* Checkbox */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-wrap input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  appearance: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.checkbox-wrap input[type="checkbox"]:checked {
  background: #0f172a;
  border-color: #0f172a;
}
.checkbox-wrap input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* Date range filter */
.date-filter { display: flex; gap: 8px; align-items: center; }
.date-filter input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f8fafc;
  color: #0f172a;
}
