/* 
 * MEAT RECEIVING MANAGEMENT APP - PRODUCTION STYLESHEET
 * Theme: Native Operational Mobile & Admin Dashboard UI
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&family=Rajdhani:wght@600;700&family=Orbitron:wght@700;800&display=swap');

:root {
  --primary-color: #0f172a;
  --primary-accent: #dc2626; /* Raw meat red accent */
  --primary-accent-hover: #b91c1c;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --dark-bg: #0f172a;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --sticky-bar-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.brand-font-logo {
  font-family: 'Rajdhani', 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.app-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

.app-logo-img-sm {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.app-logo-img-lg {
  height: 48px;
  width: auto;
  object-fit: contain;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 20px;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
}

/* ==========================================================================
   STORE RECEIVING PANEL (NATIVE MOBILE & TABLET RESPONSIVE)
   ========================================================================== */

.store-header {
  background: var(--bg-gradient);
  color: #ffffff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.store-header .brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.store-header .app-logo-img {
  height: 30px;
  max-width: 180px;
  width: auto;
  object-fit: contain;
}

.store-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease-in-out;
}

.store-card:focus-within {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Mobile Product Card Input Items */
.product-card-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-card-item:focus-within, .product-card-item.has-value {
  border-color: #dc2626;
  background-color: #fffafb;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.product-card-item .product-info {
  flex: 1;
  min-width: 0; /* Enable text ellipsis if needed */
  padding-right: 4px;
}

.product-card-item .product-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  line-height: 1.25;
  word-break: break-word;
}

.product-card-item .product-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.product-kg-input-wrap {
  width: 120px;
  flex-shrink: 0;
  position: relative;
}

.product-kg-input-wrap input {
  font-family: 'Outfit', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: right;
  padding-right: 32px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  background: #ffffff;
}

.product-kg-input-wrap input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.product-kg-input-wrap .unit-tag {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

/* Live Total & Submit Action Bar (Positioned inline below Added Product Entries) */
.sticky-submit-bar {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 18px;
  margin-top: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease-in-out;
}

.sticky-submit-container {
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.total-kg-display {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.total-kg-display .total-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.total-kg-display .total-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-accent);
  line-height: 1.1;
  white-space: nowrap;
}

.btn-submit-receiving {
  background: var(--primary-accent);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 18px;
  height: 44px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.btn-submit-receiving:hover, .btn-submit-receiving:active {
  background: var(--primary-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.btn-submit-receiving:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   ADMIN PANEL LAYOUT & DASHBOARD STYLES
   ========================================================================== */

body.admin-body {
  padding-bottom: 0;
  background-color: #f1f5f9;
}

.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles (Clean Light Theme) */
.admin-sidebar {
  width: 260px;
  background: #ffffff !important;
  color: #334155;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1020;
}

.admin-sidebar .sidebar-brand {
  padding: 18px 20px;
  color: #0f172a;
  font-size: 1.2rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-sidebar .sidebar-brand i {
  color: var(--primary-accent);
  font-size: 1.4rem;
}

.admin-sidebar .sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.admin-sidebar .nav-item {
  margin-bottom: 4px;
}

.admin-sidebar .nav-link {
  color: #475569;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-sidebar .nav-link i {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  color: #64748b;
  transition: color 0.2s ease;
}

.admin-sidebar .nav-link:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.admin-sidebar .nav-link:hover i {
  color: #dc2626;
}

.admin-sidebar .nav-link.active {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.admin-sidebar .nav-link.active i {
  color: #ffffff;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1010;
}

.admin-content {
  padding: 24px;
  flex: 1;
}

/* KPI Cards */
.kpi-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kpi-icon.icon-red { background: #fee2e2; color: #dc2626; }
.kpi-icon.icon-green { background: #d1fae5; color: #059669; }
.kpi-icon.icon-blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.icon-orange { background: #ffedd5; color: #ea580c; }

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* Live Badge Indicator */
.badge-live {
  background: #d1fae5;
  color: #047857;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Custom Accordion Component */
.custom-accordion .accordion-item {
  border: 1px solid var(--border-color);
  background: #ffffff;
  transition: all 0.2s ease;
}

.custom-accordion .accordion-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.custom-accordion .accordion-button {
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: none;
  font-weight: 600;
  padding: 16px 20px !important;
  font-size: 1.05rem;
}

.custom-accordion .accordion-button strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.custom-accordion .accordion-button .badge {
  margin-right: 8px;
  line-height: 1.3;
}

.custom-accordion .accordion-button .badge.bg-dark {
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 8px;
}

.custom-accordion .accordion-button .badge.bg-danger {
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.custom-accordion .accordion-button .badge.bg-secondary {
  font-size: 0.85rem;
  padding: 5px 10px;
  border-radius: 8px;
}

.custom-accordion .accordion-button .text-muted {
  font-size: 0.9rem;
  font-weight: 500;
}

.custom-accordion .accordion-button::after {
  width: 1.25rem;
  height: 1.25rem;
  background-size: 1.25rem;
  margin-left: 12px;
}

.custom-accordion .accordion-button:not(.collapsed) {
  background-color: #fffafb;
  color: var(--primary-accent);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.custom-accordion .accordion-button:focus {
  box-shadow: none;
  border-color: var(--primary-accent);
}

/* 3-Category Grid Table Layout (Matching Invoice Voucher Image 2) */
.invoice-grid-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.invoice-grid-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 15px;
  width: 100%;
  min-width: 600px;
}

.invoice-col-main {
  flex: 0 0 calc(50% - 7px);
  width: calc(50% - 7px);
}

.invoice-col-sub {
  flex: 0 0 calc(25% - 7px);
  width: calc(25% - 7px);
}

.category-block {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.invoice-table {
  border: 2px solid #0f172a !important;
  width: 100% !important;
  margin-bottom: 0 !important;
  border-collapse: collapse !important;
  table-layout: fixed;
  background-color: #ffffff;
}

.invoice-table th {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 6px 4px;
  height: 32px;
  border: 1px solid #334155 !important;
  vertical-align: middle;
  text-align: center;
  box-sizing: border-box;
}

.invoice-table td {
  padding: 5px 6px;
  height: 30px;
  vertical-align: middle;
  font-size: 0.75rem;
  border: 1px solid #cbd5e1 !important;
  box-sizing: border-box;
}

.invoice-table tfoot td {
  height: 32px;
  padding: 5px 6px;
  font-size: 0.75rem;
  box-sizing: border-box;
}

.custom-table {
  width: 100%;
  margin-bottom: 0;
}

.custom-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
}

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

/* Responsive Breakpoints */
@media (max-width: 480px) {
  .store-header .app-logo-img {
    height: 24px;
    max-width: 140px;
  }
  .btn-submit-receiving {
    padding: 10px 14px;
    font-size: 0.88rem;
    border-radius: 10px;
  }
  .total-kg-display .total-value {
    font-size: 1.25rem;
  }
  .total-kg-display .total-label {
    font-size: 0.62rem;
  }
  .product-card-item {
    padding: 10px 12px;
  }
  .product-kg-input-wrap {
    width: 110px;
  }
  .product-kg-input-wrap input {
    height: 42px;
    font-size: 1.05rem;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .product-kg-input-wrap {
    width: 130px;
  }
  .btn-submit-receiving {
    padding: 12px 24px;
    font-size: 1rem;
  }
  .total-kg-display .total-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .admin-navbar {
    padding: 10px 12px;
  }
  .admin-content {
    padding: 12px;
  }
  .kpi-card {
    padding: 12px 10px;
    gap: 8px;
    border-radius: 14px;
  }
  .kpi-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    border-radius: 10px;
  }
  .kpi-title {
    font-size: 0.62rem;
    letter-spacing: 0.2px;
  }
  .kpi-value {
    font-size: 1.15rem;
    white-space: nowrap;
  }
  .badge-live {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
  .custom-accordion .accordion-button {
    padding: 14px 12px !important;
  }
  .custom-accordion .accordion-button::after {
    margin-left: 6px;
    width: 1.1rem;
    height: 1.1rem;
    background-size: 1.1rem;
  }
}

/* Bootstrap 5 Native Offcanvas Sidebar Integration (Clean Light Theme) */
.admin-sidebar {
  background: #ffffff !important;
  color: #334155;
}

@media (max-width: 991.98px) {
  .admin-sidebar.offcanvas-lg {
    width: 270px !important;
    max-width: 85vw !important;
    border-right: none !important;
    z-index: 1045 !important;
  }
  .admin-main {
    margin-left: 0 !important;
  }
}

@media (min-width: 992px) {
  .admin-sidebar {
    width: 260px !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1020 !important;
    transform: none !important;
    visibility: visible !important;
  }
  .admin-main {
    margin-left: 260px !important;
  }
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    padding-bottom: 0 !important;
  }
  .admin-sidebar, .admin-navbar, .no-print, .btn, .pagination, .sticky-submit-bar {
    display: none !important;
  }
  .admin-main {
    margin-left: 0 !important;
  }
  .admin-content {
    padding: 0 !important;
  }
  .custom-table-card {
    border: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   PRODUCT DROPDOWN ENTRY & ADDED ENTRIES LIST STYLES
   ========================================================================== */

.product-entry-box {
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease-in-out;
}

.product-entry-box:focus-within {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.added-entry-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  animation: fadeIn 0.3s ease-in-out;
}

.added-entry-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.added-entry-row .entry-info {
  flex: 1;
  min-width: 0;
}

.added-entry-row .entry-product-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
  word-break: break-word;
}

.added-entry-row .entry-category-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.added-entry-row .entry-qty-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-accent);
  white-space: nowrap;
}

.btn-remove-entry {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-remove-entry:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.empty-entries-box {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}

/* Today's Receiving Log Cards */
.today-entry-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.today-entry-card .header-part {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

