/* ================================================================
   I-HALAL — Ultra-Modern SaaS Design System
   Dark forest green + glassmorphism + Segoe UI
   ================================================================ */

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  /* Brand colours */
  --ih-forest:       #006939;
  --ih-forest-mid:   #047545;
  --ih-forest-light: #0b8551;
  --ih-emerald:      #00a866;
  --ih-emerald-soft: #D1FAE5;
  --ih-emerald-dim:  rgba(16,185,129,.10);

  /* Status */
  --ih-amber:        #F59E0B;
  --ih-amber-soft:   #FEF3C7;
  --ih-red:          #EF4444;
  --ih-red-soft:     rgba(239,68,68,.10);

  /* Surfaces */
  --ih-bg:           #F0F4F1;
  --ih-surface:      #FFFFFF;
  --ih-surface-2:    #F6FAF7;
  --ih-border:       rgba(10,54,34,.10);

  /* Text */
  --ih-ink:          #0A1F14;
  --ih-body:         #374151;
  --ih-muted:        #6B7280;

  /* Radii */
  --ih-r-sm:   8px;
  --ih-r-md:   12px;
  --ih-r-lg:   16px;
  --ih-r-xl:   24px;
  --ih-r-2xl:  32px;

  /* Shadows */
  --ih-shadow:       0 1px 3px rgba(10,54,34,.06), 0 4px 16px rgba(10,54,34,.06);
  --ih-shadow-md:    0 4px 20px rgba(10,54,34,.10);
  --ih-shadow-lg:    0 8px 40px rgba(10,54,34,.14);
  --ih-shadow-glow:  0 0 0 3px rgba(16,185,129,.18);
}

/* ── Base reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ih-body);
  background: var(--ih-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ih-ink);
  letter-spacing: -.03em;
  line-height: 1.2;
}

a {
  color: var(--ih-emerald);
  transition: color .18s;
}
a:hover { color: var(--ih-forest); }

/* ── Navbar ──────────────────────────────────────────────────── */
.hc-navbar {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ih-border);
  transition: box-shadow .25s;
  padding: .6rem 0;
}
.hc-navbar .navbar-brand span { font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -.04em; color: var(--ih-ink); }
.hc-navbar .nav-link { font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-weight: 500; font-size: .9rem; color: var(--ih-muted); border-radius: 8px; padding: .4rem .75rem !important; transition: color .18s, background .18s; }
.hc-navbar .nav-link:hover { color: var(--ih-ink); background: var(--ih-emerald-dim); }
.hc-navbar .nav-link.active { color: var(--ih-forest); font-weight: 600; background: var(--ih-emerald-dim); }
.hc-navbar.hc-navbar-scrolled { box-shadow: 0 1px 0 var(--ih-border), 0 4px 20px rgba(10,54,34,.08); }

.hc-search-input {
  background: var(--ih-surface-2);
  border: 1px solid var(--ih-border);
  color: var(--ih-ink);
  font-size: .85rem;
}
.hc-search-input:focus {
  background: var(--ih-surface);
  border-color: var(--ih-emerald);
  box-shadow: var(--ih-shadow-glow);
}

/* ── Page header ─────────────────────────────────────────────── */
.hc-page-header {
  background: var(--ih-surface);
  border-bottom: 1px solid var(--ih-border);
  padding: 3rem 0 2.5rem;
}
.hc-page-header h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.04em;
}
.hc-page-header .breadcrumb-item a {
  color: var(--ih-muted);
  text-decoration: none;
}
.hc-page-header .breadcrumb-item a:hover { color: var(--ih-emerald); }
.hc-page-header .breadcrumb-item + .breadcrumb-item::before { color: var(--ih-muted); }

/* Section tag */
.ih-section-tag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--ih-emerald-dim);
  color: var(--ih-emerald);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 99px;
  padding: .3em 1em;
  font-size: .78rem;
  font-weight: 700;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
}

/* Section title */
.ih-section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.04em;
  margin-bottom: 0;
}

/* Badge pill */
.ih-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(16,185,129,.18);
  color: #a7f3d0;
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 99px;
  padding: .4em 1.2em;
  font-size: .8rem;
  font-weight: 700;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  letter-spacing: .04em;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hc-hero {
  background: linear-gradient(135deg, var(--ih-forest) 0%, var(--ih-forest-mid) 55%, #0d5c35 100%);
  padding: 6rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2310B981' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hc-hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.1;
}
.hc-hero .lead {
  color: rgba(255,255,255,.7);
  font-size: 1.1rem;
  line-height: 1.7;
}
.ih-accent {
  background: linear-gradient(135deg, var(--ih-emerald) 0%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero search form */
.hc-hero-search .input-group {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(16,185,129,.35);
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.hc-hero-search .input-group-text {
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.7);
}
.hc-hero-search .form-control {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 1rem;
}
.hc-hero-search .form-control::placeholder { color: rgba(255,255,255,.5); }
.hc-hero-search .form-control:focus {
  background: rgba(255,255,255,.15);
  box-shadow: none;
}
.hc-hero-search .btn {
  background: var(--ih-emerald);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 0;
  padding: 0 1.75rem;
}
.hc-hero-search .btn:hover { background: #0ea572; }

/* Glass card */
.hc-glass-card {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--ih-r-xl);
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.ih-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* Cert icon in glass card */
.hc-cert-icon {
  width: 48px;
  height: 48px;
  background: rgba(16,185,129,.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--ih-emerald);
  flex-shrink: 0;
}

/* ── Stats bar ───────────────────────────────────────────────── */
.hc-stats-bar {
  background: var(--ih-surface);
  border-bottom: 1px solid var(--ih-border);
}
.hc-stat { padding: .75rem 1rem; }
.hc-stat-number {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--ih-forest) 0%, var(--ih-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: .3rem;
}
.hc-stat-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ih-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.hc-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--ih-border);
  margin: 0 1rem;
}

/* ── Feature cards ───────────────────────────────────────────── */
.hc-feature {
  background: var(--ih-surface);
  border-radius: var(--ih-r-xl);
  padding: 2rem;
  border: 1px solid var(--ih-border);
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--ih-shadow);
}
.hc-feature::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ih-emerald-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .25s;
}
.hc-feature:hover { transform: translateY(-5px); box-shadow: var(--ih-shadow-lg); }
.hc-feature:hover::after { opacity: 1; }

.hc-feature-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--ih-forest), var(--ih-forest-mid));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--ih-emerald);
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(10,54,34,.2);
  position: relative;
  z-index: 1;
}
.hc-feature h5 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .6rem;
  position: relative;
  z-index: 1;
}
.hc-feature p {
  color: var(--ih-muted);
  font-size: .9rem;
  line-height: 1.65;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

/* ── Product cards ───────────────────────────────────────────── */
.hc-product-card {
  background: var(--ih-surface);
  border-radius: var(--ih-r-xl) !important;
  border: 1px solid var(--ih-border) !important;
  box-shadow: var(--ih-shadow) !important;
  transition: transform .25s, box-shadow .25s;
  overflow: hidden;
}
.hc-product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ih-shadow-lg) !important;
  border-color: rgba(16,185,129,.3) !important;
}

.hc-product-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--ih-surface-2);
}
.hc-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.hc-product-card:hover .hc-product-image img { transform: scale(1.04); }

.hc-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: .72rem;
  font-weight: 700;
  padding: .35em .85em;
  border-radius: 99px;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Product detail image */
.hc-product-detail-image {
  border-radius: var(--ih-r-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--ih-surface-2);
  box-shadow: var(--ih-shadow-md);
}
.hc-product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Meta blocks */
.hc-meta {
  background: var(--ih-surface-2);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-r-md);
  padding: .75rem 1rem;
}
.hc-meta .text-muted { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .2rem; }
.hc-meta .fw-bold { color: var(--ih-ink); font-size: .95rem; }

/* ── E-code chips ────────────────────────────────────────────── */
.hc-ecode-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--ih-surface);
  border: 1.5px solid;
  border-radius: 10px;
  padding: .45em 1em;
  font-size: .85rem;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
  color: var(--ih-body);
}
.hc-ecode-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--ih-shadow-md);
  color: var(--ih-body);
}
.hc-ecode-chip-code {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  font-size: .9rem;
}

/* ── Timeline (traceability) ─────────────────────────────────── */
.hc-timeline {
  position: relative;
  padding-left: 2.5rem;
}
.hc-timeline::before {
  content: '';
  position: absolute;
  left: .8rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--ih-emerald), transparent);
}
.hc-timeline-item {
  position: relative;
  padding-bottom: 1.75rem;
}
.hc-timeline-item:last-child { padding-bottom: 0; }
.hc-timeline-marker {
  position: absolute;
  left: -2.5rem;
  width: 32px;
  height: 32px;
  background: var(--ih-forest);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ih-emerald);
  font-weight: 700;
  font-size: .85rem;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(10,54,34,.2);
}
.hc-timeline-content {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-r-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--ih-shadow);
}

/* ── Certificate image block ─────────────────────────────────── */
.hc-cert-image {
  background: linear-gradient(135deg, var(--ih-forest), var(--ih-forest-mid));
  border-radius: var(--ih-r-lg);
  padding: 1.75rem;
  text-align: center;
  color: var(--ih-emerald);
  font-size: 2.5rem;
  box-shadow: var(--ih-shadow-md);
}

/* ── Sidebar filters ─────────────────────────────────────────── */
.hc-filters {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-r-xl);
  padding: 1.5rem;
  box-shadow: var(--ih-shadow);
  position: sticky;
  top: 88px;
}
.hc-filters .form-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ih-muted);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.hc-filters .btn-outline-secondary.text-start {
  text-align: left;
  border-color: var(--ih-border);
  color: var(--ih-body);
  border-radius: var(--ih-r-md) !important;
  font-size: .88rem;
  margin-bottom: 4px;
}
.hc-filters .btn-check:checked + .btn-outline-secondary {
  background: var(--ih-emerald-dim);
  border-color: var(--ih-emerald);
  color: var(--ih-forest);
}
.hc-filters .btn-check:checked + .btn-outline-success {
  background: var(--ih-emerald);
  border-color: var(--ih-emerald);
  color: #fff;
}
.hc-filters .btn-check:checked + .btn-outline-warning {
  background: var(--ih-amber);
  border-color: var(--ih-amber);
  color: #fff;
}
.hc-filters .btn-check:checked + .btn-outline-danger {
  background: var(--ih-red);
  border-color: var(--ih-red);
  color: #fff;
}
.hc-filters .form-select {
  border-color: var(--ih-border);
  border-radius: var(--ih-r-md);
  font-size: .88rem;
  color: var(--ih-ink);
  background-color: var(--ih-surface-2);
}
.hc-filters .form-select:focus { border-color: var(--ih-emerald); box-shadow: var(--ih-shadow-glow); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  border-radius: 10px;
  transition: all .2s ease;
  font-size: .9rem;
}
.btn-lg { border-radius: 12px; }

.btn-success {
  background: var(--ih-forest);
  border-color: var(--ih-forest);
  color: #fff;
}
.btn-success:hover, .btn-success:focus {
  background: var(--ih-forest-light);
  border-color: var(--ih-forest-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(10,54,34,.2);
}

.btn-outline-success {
  color: var(--ih-forest);
  border-color: var(--ih-forest);
}
.btn-outline-success:hover {
  background: var(--ih-forest);
  border-color: var(--ih-forest);
  color: #fff;
}

.btn-outline-secondary {
  color: var(--ih-muted);
  border-color: var(--ih-border);
  background: transparent;
}
.btn-outline-secondary:hover {
  background: var(--ih-surface-2);
  color: var(--ih-ink);
  border-color: rgba(10,54,34,.2);
}

.btn-light { background: rgba(255,255,255,.9); color: var(--ih-ink); border-color: transparent; }
.btn-light:hover { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: 0;
  border-radius: 999px;
  padding: .42em .8em;
}
.bg-success { background-color: var(--ih-forest) !important; color: #fff !important; }
.bg-warning { background-color: var(--ih-amber) !important; color: #fff !important; }
.bg-danger  { background-color: var(--ih-red) !important; color: #fff !important; }
.bg-secondary { background-color: #6b7280 !important; }
.text-success { color: var(--ih-emerald) !important; }
.text-warning { color: var(--ih-amber) !important; }
.text-danger  { color: var(--ih-red) !important; }
.text-muted   { color: var(--ih-muted) !important; }
.bg-success-subtle { background-color: var(--ih-emerald-soft) !important; }
.bg-light { background-color: var(--ih-surface-2) !important; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border) !important;
  border-radius: var(--ih-r-xl) !important;
  box-shadow: var(--ih-shadow) !important;
}
.card.shadow-sm { box-shadow: var(--ih-shadow) !important; }
.card.shadow-lg { box-shadow: var(--ih-shadow-lg) !important; }

/* ── Tables ──────────────────────────────────────────────────── */
.table { color: var(--ih-body); }
.table th {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ih-muted);
  border-color: var(--ih-border);
}
.table td { border-color: var(--ih-border); font-size: .9rem; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background-color: var(--ih-emerald-dim); }
.table-light th { background: var(--ih-surface-2) !important; }

/* ── Form controls ───────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--ih-border);
  border-radius: var(--ih-r-md);
  color: var(--ih-ink);
  font-size: .9rem;
  background-color: var(--ih-surface);
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ih-emerald);
  box-shadow: var(--ih-shadow-glow);
  background-color: var(--ih-surface);
}
.form-control::placeholder { color: var(--ih-muted); }
.input-group-text {
  background: var(--ih-surface-2);
  border-color: var(--ih-border);
  color: var(--ih-muted);
}

/* ── Footer ──────────────────────────────────────────────────── */
.hc-footer {
  background: var(--ih-forest);
  color: rgba(255,255,255,.75);
}
.hc-footer a { color: rgba(255,255,255,.6); text-decoration: none; transition: color .18s; }
.hc-footer a:hover { color: var(--ih-emerald); }
.hc-footer h6 {
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1rem;
}
.hc-footer-brand {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -.04em;
}
.hc-footer-brand span { color: var(--ih-emerald); }

/* ── Utility ─────────────────────────────────────────────────── */
.hc-line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hc-line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.font-monospace { font-family: Consolas, "Courier New", monospace; }

/* Empty state */
.hc-empty { background: var(--ih-surface); border: 1px dashed var(--ih-border); border-radius: var(--ih-r-xl); padding: 4rem 2rem; }

/* Dropdown */
.dropdown-menu {
  border-color: var(--ih-border);
  border-radius: var(--ih-r-lg);
  box-shadow: var(--ih-shadow-md);
}
.dropdown-item { font-size: .9rem; color: var(--ih-body); border-radius: var(--ih-r-sm); }
.dropdown-item:hover { background: var(--ih-emerald-dim); color: var(--ih-ink); }
.dropdown-item.active { background: var(--ih-forest); color: #fff; }

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 768px) {
  .hc-page-header { padding: 2rem 0 1.75rem; }
  .hc-hero { padding: 4rem 0 3.5rem; }
  .hc-filters { position: static; }
  .hc-stats-bar .hc-stat-number { font-size: 1.5rem; }
}

/* ── Scrollbar (webkit) ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ih-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(10,54,34,.2); }


