@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-dark: #312e81;
  --secondary: #64748b;
  --bg-body: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-hover-bg: #1e293b;
  --sidebar-active-bg: #4f46e5;
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #0ea5e9;
  --info-light: #f0f9ff;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* App Layout */
.app-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
}

.sidebar-body::-webkit-scrollbar {
  width: 4px;
}
.sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
  padding: 0.75rem 0.85rem 0.35rem;
  margin-top: 0.5rem;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
  background-color: var(--sidebar-hover-bg);
}

.nav-link:hover i {
  transform: translateX(2px);
}

.nav-link.active {
  color: var(--sidebar-text-active);
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Main Content */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar */
.app-topbar {
  height: var(--topbar-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-toggler {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.65rem;
  color: var(--text-main);
  cursor: pointer;
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Page Container */
.page-container {
  flex: 1;
  padding: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.breadcrumb-nav {
  --bs-breadcrumb-divider: '›';
  font-size: 0.825rem;
  margin: 0.25rem 0 0;
}

/* Modern Card */
.card-pro {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card-pro-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header-pro {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-body-pro {
  padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.stat-primary::before { background: var(--primary); }
.stat-success::before { background: var(--success); }
.stat-warning::before { background: var(--warning); }
.stat-danger::before { background: var(--danger); }
.stat-info::before { background: var(--info); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-info .stat-icon { background: var(--info-light); color: var(--info); }

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* Tables */
.table-pro {
  width: 100%;
  margin-bottom: 0;
  vertical-align: middle;
}

.table-pro th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-pro td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-main);
}

.table-pro tbody tr:last-child td {
  border-bottom: none;
}

.table-pro tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge-status {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Status colors */
.badge-received { background: #e0e7ff; color: #4338ca; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-washing { background: #e0f2fe; color: #0369a1; }
.badge-drying { background: #fce7f3; color: #be185d; }
.badge-ironing { background: #ede9fe; color: #6d28d9; }
.badge-qc { background: #ccfbf1; color: #0f766e; }
.badge-completed { background: #dcfce7; color: #15803d; }
.badge-picked_up { background: #f1f5f9; color: #334155; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }

/* Payment Badges */
.badge-unpaid { background: #fee2e2; color: #b91c1c; }
.badge-down_payment { background: #ffedd5; color: #c2410c; }
.badge-partial { background: #fef3c7; color: #b45309; }
.badge-paid { background: #dcfce7; color: #15803d; }
.badge-refunded { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn-primary-pro {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-primary-pro:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.btn-outline-pro {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-outline-pro:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-main);
}

/* Forms */
.form-control, .form-select {
  border-color: var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-main);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

/* POS Cashier Screen */
.pos-product-card {
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pos-product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pos-cart-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cart-items-wrapper {
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
}

/* Thermal Receipt Styling */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-receipt, .printable-receipt * {
    visibility: visible;
  }
  .printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .no-print {
    display: none !important;
  }
}

.receipt-box-58 {
  width: 58mm;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.3;
  margin: 0 auto;
  padding: 8px 4px;
  background: #fff;
  color: #000;
}

.receipt-box-80 {
  width: 80mm;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  margin: 0 auto;
  padding: 10px 8px;
  background: #fff;
  color: #000;
}

.receipt-divider {
  border-top: 1px dashed #000;
  margin: 6px 0;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .sidebar-toggler {
    display: block;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

