/* ============================================================
   InventoryQR by SIMPLIFIED — style.css v2.1
   ============================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #FCFAF7;
  color: #555555;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}
a { color: #BFA2DB; text-decoration: none; }
a:hover { color: #d9967f; }

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: #2d2640;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  overflow-x: hidden;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: #BFA2DB;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.sidebar-brand-text { overflow: hidden; white-space: nowrap; }
.brand-main {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.2;
}
.brand-main span { color: #BFA2DB; font-weight: 300; }
.brand-sub { font-size: 0.62rem; color: rgba(255,255,255,0.4); letter-spacing: 0.5px; }

/* Nav scroll wrapper */
.sidebar-nav {
  flex: 1;
  padding: 10px 0 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Section labels */
.nav-section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.28);
  padding: 10px 18px 3px;
  white-space: nowrap;
}

/* Nav links */
.nav-item-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.65);
  font-size: 0.87rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.nav-item-link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.nav-item-link:hover {
  background: #3d3455;
  color: #fff;
  text-decoration: none;
}
.nav-item-link.active {
  background: #3d3455;
  color: #fff;
  border-left-color: #BFA2DB;
}
.nav-item-link.active i { color: #BFA2DB; }

/* Submenu */
.nav-submenu { display: none; background: rgba(0,0,0,0.18); }
.nav-submenu.open { display: block; }
.nav-submenu .nav-item-link {
  padding-left: 44px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  border-left: 3px solid transparent;
}
.nav-submenu .nav-item-link:hover { color: rgba(255,255,255,0.85); }
.nav-submenu .nav-item-link.active { color: #fff; border-left-color: #BFA2DB; }

.nav-toggle-arrow {
  margin-left: auto;
  font-size: 0.68rem;
  transition: transform 0.2s;
  flex-shrink: 0;
  color: rgba(255,255,255,0.35);
}
.nav-toggle-arrow.open { transform: rotate(90deg); }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #BFA2DB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; white-space: nowrap; }
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 0.65rem; color: rgba(255,255,255,0.45); }
.btn-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-sidebar-logout:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e8e0f0;
  padding: 0 1.25rem;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.btn-sidebar-toggle {
  background: none;
  border: 1px solid #e8e0f0;
  color: #555;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 6px;
  line-height: 1;
  display: none;
}
.btn-sidebar-toggle:hover { background: #f0e8ff; }
.topbar-page-title { font-size: 0.9rem; font-weight: 600; color: #555; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-wrapper {
  margin-left: 230px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #FCFAF7;
  transition: margin-left 0.25s ease;
}
.main-content {
  flex: 1;
  padding: 1.25rem 1.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e8e0f0;
  padding: 0.65rem 1.5rem;
  font-size: 0.8rem;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   SIDEBAR OVERLAY + MOBILE
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1039;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-wrapper { margin-left: 0; }
  .btn-sidebar-toggle { display: inline-block; }
  .main-content { padding: 1rem; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background-color: #E8B4A2 !important;
  border-color: #E8B4A2 !important;
  color: #fff !important;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #d9967f !important;
  border-color: #d9967f !important;
  color: #fff !important;
}
.btn-lavender {
  background-color: #BFA2DB;
  border-color: #BFA2DB;
  color: #fff;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-lavender:hover {
  background-color: #a888cc;
  border-color: #a888cc;
  color: #fff;
}
.btn-primary-custom {
  background-color: #E8B4A2;
  border-color: #E8B4A2;
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-block;
}
.btn-primary-custom:hover {
  background-color: #d9967f;
  color: #fff;
}
.btn-logout {
  background: rgba(255,255,255,0.2);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.35); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  border: 1px solid #e8e0f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background: #ffffff;
}
.card-header {
  background: #FCFAF7;
  border-bottom: 1px solid #e8e0f0;
  font-weight: 600;
  color: #555555;
  padding: 0.8rem 1.2rem;
  border-radius: 10px 10px 0 0;
}

/* Stat cards */
.stat-card {
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.stat-card .stat-icon { font-size: 1.7rem; opacity: 0.75; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 0.8rem; opacity: 0.85; font-weight: 500; }
.stat-lavender { background: #BFA2DB; color: #fff; }
.stat-peach    { background: #E8B4A2; color: #fff; }
.stat-pink     { background: #F5D5E0; color: #555555; }
.stat-cream    { background: #f0e8ff; color: #555555; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  background: #ffffff;
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.page-header h1, .page-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #555555;
  margin: 0;
}
.page-header-icon { color: #BFA2DB; margin-right: 0.4rem; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
  border-color: #e8e0f0;
  border-radius: 6px;
  color: #555555;
  font-size: 0.91rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: #BFA2DB;
  box-shadow: 0 0 0 0.2rem rgba(191,162,219,0.25);
}
.form-control-lg { min-height: 46px; font-size: 0.97rem; }
.form-label { font-weight: 600; font-size: 0.84rem; color: #555555; margin-bottom: 0.3rem; }

/* ============================================================
   TABLES
   ============================================================ */
.table { color: #555555; font-size: 0.87rem; }
.table th {
  background: #FCFAF7;
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #999;
  border-bottom: 2px solid #e8e0f0;
  padding: 0.7rem 0.9rem;
  white-space: nowrap;
}
.table td {
  padding: 0.65rem 0.9rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0ecf8;
}
.table tbody tr:hover { background-color: #faf8ff; }
.table-responsive { border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* ============================================================
   QR CODE BADGE
   ============================================================ */
.qr-code-badge {
  background: #FCFAF7;
  border: 1px solid #e8e0f0;
  border-radius: 6px;
  padding: 0.22rem 0.65rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: #BFA2DB;
  font-weight: 600;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: 0.7rem; padding: 0.28em 0.58em; font-weight: 600; border-radius: 20px; }
.text-lavender { color: #BFA2DB !important; }
.text-peach    { color: #E8B4A2 !important; }

/* ============================================================
   ALERT
   ============================================================ */
.alert { border-radius: 6px; border: none; font-size: 0.87rem; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0e8ff 0%, #FCFAF7 50%, #F5D5E0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(191,162,219,0.2);
  border: none;
  overflow: hidden;
}
.login-header {
  background: #BFA2DB;
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}
.login-logo-icon {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff; margin: 0 auto 1rem;
}
.login-header h2 { color: #fff; font-size: 1.4rem; font-weight: 700; margin: 0 0 0.25rem; }
.login-header p  { color: rgba(255,255,255,0.8); font-size: 0.84rem; margin: 0; }
.login-body { padding: 2rem; background: #ffffff; }
.password-wrapper { position: relative; }
.password-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; color: #aaa; cursor: pointer; padding: 0; font-size: 1rem;
}
.password-toggle:hover { color: #BFA2DB; }

/* ============================================================
   PRODUCT DETAIL
   ============================================================ */
.discontinued-banner {
  background: #e74c3c; color: #fff; text-align: center;
  padding: 1.1rem 1rem; border-radius: 10px; margin-bottom: 1.25rem;
  animation: pulse-banner 2s infinite;
}
.discontinued-banner h3 {
  font-size: 1.25rem; font-weight: 800; margin: 0 0 0.2rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.discontinued-banner p { margin: 0; font-size: 0.88rem; opacity: 0.9; }
@keyframes pulse-banner { 0%,100%{opacity:1;} 50%{opacity:0.85;} }

.product-detail-card { border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.product-image-wrapper { background: #FCFAF7; text-align: center; padding: 1rem; }
.product-image-wrapper img { max-width: 100%; max-height: 280px; object-fit: contain; border-radius: 6px; }
.product-image-placeholder {
  width: 100%; height: 190px;
  background: linear-gradient(135deg, #f0e8ff, #F5D5E0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #BFA2DB; border-radius: 6px;
}
.product-price-display { font-size: 1.65rem; font-weight: 800; color: #BFA2DB; }
.product-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.spec-item {
  background: #FCFAF7; border-radius: 6px;
  padding: 0.55rem 0.8rem; border: 1px solid #e8e0f0;
}
.spec-label {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.5px; color: #bbb; font-weight: 600; margin-bottom: 0.12rem;
}
.spec-value { font-size: 0.9rem; font-weight: 600; color: #555555; }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-wrapper { position: relative; }
.search-wrapper .search-icon {
  position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%); color: #BFA2DB; font-size: 1.15rem; z-index: 2;
}
.search-wrapper input {
  padding-left: 46px; height: 50px; font-size: 0.97rem;
  border: 2px solid #e8e0f0; border-radius: 10px;
}
.search-wrapper input:focus { border-color: #BFA2DB; }
.search-result-card {
  background: #ffffff; border: 1px solid #e8e0f0; border-radius: 10px;
  padding: 0.85rem 1rem; transition: box-shadow 0.2s, transform 0.2s;
  display: flex; align-items: center; gap: 0.85rem;
}
.search-result-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); transform: translateY(-1px); }
.search-result-thumb { width: 58px; height: 58px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.search-result-thumb-placeholder {
  width: 58px; height: 58px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, #f0e8ff, #F5D5E0);
  display: flex; align-items: center; justify-content: center;
  color: #BFA2DB; font-size: 1.4rem;
}
#search-spinner { display: none; text-align: center; padding: 2rem; color: #BFA2DB; }

/* ============================================================
   QUICK ACTIONS (dashboard)
   ============================================================ */
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.4rem; padding: 1rem;
  border-radius: 10px; border: 2px solid #e8e0f0;
  background: #ffffff; color: #555555;
  font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s; min-height: 80px;
}
.quick-action-btn i { font-size: 1.45rem; color: #BFA2DB; }
.quick-action-btn:hover {
  border-color: #BFA2DB; background: #f7f0ff;
  color: #555555; transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ============================================================
   IMAGE PREVIEW BOX
   ============================================================ */
.img-preview-box {
  width: 120px; height: 120px;
  border: 2px dashed #e8e0f0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #FCFAF7;
  color: #ccc; font-size: 2.5rem; cursor: pointer;
  transition: border-color 0.2s;
}
.img-preview-box:hover { border-color: #BFA2DB; }
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-hero {
  background: linear-gradient(135deg, #f0e8ff 0%, #F5D5E0 100%);
  padding: 5rem 0 4rem;
}
.landing-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800; color: #555555; line-height: 1.25;
}
.step-circle {
  width: 48px; height: 48px; background: #BFA2DB; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 700; margin: 0 auto 0.9rem;
  box-shadow: 0 4px 12px rgba(191,162,219,0.4);
}
.feature-icon-box {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, #f0e8ff, #F5D5E0);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 1.35rem;
  color: #BFA2DB; margin: 0 auto 0.9rem;
}
.card-hover { transition: transform 0.2s, box-shadow 0.2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.10) !important; }
.section-pink  { background: #F5D5E0; }
.section-cream { background: #FCFAF7; }

/* ============================================================
   MODAL HEADER (inline add godown/rack)
   ============================================================ */
.modal-content { border-radius: 10px; border: none; }
.modal-header {
  background: #BFA2DB; color: #fff;
  border-radius: 10px 10px 0 0; padding: 1rem 1.25rem;
}
.modal-header .btn-close { filter: invert(1); opacity: 0.8; }
.modal-header .modal-title { font-size: 1rem; font-weight: 700; }

/* ============================================================
   MASTER TABLE
   ============================================================ */
.master-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
.master-table td { font-size: 0.86rem; vertical-align: middle; }
.edit-form { display: none; }
.badge-active   { background: #d4edda; color: #155724; padding: 3px 10px; border-radius: 20px; font-size: 0.73rem; font-weight: 600; }
.badge-inactive { background: #f8d7da; color: #721c24; padding: 3px 10px; border-radius: 20px; font-size: 0.73rem; font-weight: 600; }

/* ============================================================
   AUTOCOMPLETE
   ============================================================ */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
  background: #fff; border: 1px solid #e8e0f0;
  border-top: none; border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-height: 200px; overflow-y: auto; display: none;
}
.autocomplete-item {
  padding: 8px 13px; font-size: 0.86rem; cursor: pointer;
  color: #555555; border-bottom: 1px solid #f5f0ff;
}
.autocomplete-item:hover { background: #f0e8ff; color: #BFA2DB; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .sidebar-overlay, .topbar, .site-footer,
  .no-print, .page-header .btn, nav, .alert { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  body { background: #fff !important; }
  .main-content { padding: 0 !important; }
  @page { size: A4 portrait; margin: 5mm; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 576px) {
  .product-spec-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 1.4rem; }
}
