:root {
  --navy: #1A2B4C;
  --navy-light: #2C3E66;
  --ink: #333333;
  --ink-soft: #7F8C8D;
  --mist: #EEF2F7;
  --paper: #EEF2F7;
  --leaf: #27AE60;
  --leaf-deep: #1e8449;
  --citrus: #F5A623;
  --citrus-deep: #E09515;
  --coral: #E74C3C;
  --success: #27AE60;
  --danger: #E74C3C;
  --line: rgba(26, 43, 76, 0.12);
  --glass: rgba(255, 255, 255, 0.92);
  --shadow: 0 14px 32px rgba(26, 43, 76, 0.08);
  --radius: 16px;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --sidebar-w: 280px;
  --accent: #F5A623;
  --accent-deep: #E09515;
  --sidebar-bg: #1A2B4C;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--paper);
  min-height: 100vh;
}

body::before {
  display: none;
}

a { color: inherit; }

/* ——— Login ——— */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  position: relative;
  z-index: 1;
}

.login-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #f8fafc;
  background:
    linear-gradient(160deg, rgba(26, 43, 76, 0.35), rgba(26, 43, 76, 0.88)),
    linear-gradient(145deg, var(--navy) 0%, var(--navy-light) 58%, #15233f 100%);
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -20% 20%;
  height: 70%;
  background:
    radial-gradient(closest-side, rgba(245, 158, 11, 0.35), transparent 70%),
    repeating-linear-gradient(-18deg, transparent 0 14px, rgba(255,255,255,0.05) 14px 15px);
  transform: rotate(-8deg);
  animation: drift 14s ease-in-out infinite alternate;
}

.login-hero-content { position: relative; z-index: 1; max-width: 34rem; }

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--citrus);
  margin-bottom: 1rem;
  font-weight: 600;
}

.login-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 0.95;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.login-hero p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(244, 250, 246, 0.82);
  max-width: 28rem;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-box {
  width: min(420px, 100%);
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: rise 0.7s ease both;
}

.login-box h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.login-box .lead {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.form-control, .form-select {
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  background: rgba(255,255,255,0.9) !important;
  padding: 0.7rem 0.9rem !important;
  box-shadow: none !important;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--citrus) !important;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.22) !important;
}

.btn-brand {
  background: var(--citrus);
  color: var(--navy) !important;
  border: 0;
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform .2s ease, background .2s ease;
}

.btn-brand:hover {
  background: var(--citrus-deep);
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-outline-leaf {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.45rem 0.95rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background .2s, border-color .2s;
}

.btn-outline-leaf:hover {
  background: rgba(245, 166, 35, 0.12);
  border-color: var(--citrus);
  color: var(--ink);
}

.btn-citrus {
  background: var(--citrus);
  color: var(--navy) !important;
  border: 0;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.demo-chip {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px dashed rgba(13, 148, 136, 0.4);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ——— Shell ——— */
.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 1.25rem 1rem 1.5rem;
  color: #cbd5e1;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.06);
  animation: slideIn 0.55s ease both;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.55rem 1.25rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--citrus);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.brand-text .name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-text .name .brand-accent { color: var(--citrus); }

.brand-text .tag {
  font-size: 0.72rem;
  color: rgba(245, 166, 35, 0.85);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-label {
  margin: 1rem 0.55rem 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.admin-sidebar a.nav-link-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: rgba(255,255,255,0.78);
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .2s, color .2s, transform .2s;
}

.admin-sidebar a.nav-link-item .nav-ico {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  font-size: 0.75rem;
  color: #fff;
}

.admin-sidebar a.nav-link-item:hover {
  background: var(--navy-light);
  color: #fff;
  transform: translateX(2px);
}

.admin-sidebar a.nav-link-item.active {
  background: var(--navy-light);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--citrus);
}

.admin-main {
  padding: 1.35rem clamp(1rem, 2.5vw, 2rem) 2.5rem;
  animation: rise 0.55s ease both;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-top h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.admin-top .page-sub {
  color: var(--ink-soft);
  margin-top: 0.25rem;
  font-size: 0.92rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem 0.55rem 0.55rem;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--citrus), var(--citrus-deep));
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.user-pill .meta { line-height: 1.2; }
.user-pill .meta strong { display: block; font-size: 0.88rem; }
.user-pill .meta span { font-size: 0.75rem; color: var(--ink-soft); }

.flash-stack .alert {
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  border-left: 4px solid var(--citrus);
  box-shadow: var(--shadow);
}

.flash-stack .alert-danger { border-left-color: var(--danger); }
.flash-stack .alert-success { border-left-color: var(--success); }

/* ——— Dashboard graphics ——— */
.hero-band {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1.25rem;
  color: #f8fafc;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  box-shadow: var(--shadow);
}

.hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(120deg, transparent 0 18px, rgba(255,255,255,0.03) 18px 19px);
  pointer-events: none;
}

.hero-band > * { position: relative; z-index: 1; }

.hero-band .eyebrow {
  color: var(--citrus);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-band h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
}

.hero-band p { margin: 0; color: rgba(245, 251, 247, 0.78); max-width: 36rem; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid rgba(26,43,76,0.08);
  border-top: 4px solid var(--navy);
  box-shadow: var(--shadow);
  transition: transform .25s ease;
}

.kpi:hover { transform: translateY(-3px); }

.kpi.kpi-amber { border-top-color: var(--citrus); }
.kpi.kpi-success { border-top-color: var(--success); }
.kpi.kpi-danger, .kpi.kpi-warn { border-top-color: var(--danger); }

.kpi .kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 650;
}

.kpi .kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  margin-top: 0.35rem;
  line-height: 1;
  color: var(--navy);
}

.kpi .kpi-foot {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.kpi .spark {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.22), transparent 65%);
}

.kpi.kpi-warn .kpi-value { color: var(--danger); }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel {
  background: #fff;
  border: 1px solid rgba(26,43,76,0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel .panel-h {
  padding: 1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.panel .panel-h strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.panel .panel-b { padding: 1rem 1.15rem; }

.chart-wrap {
  position: relative;
  height: 240px;
}

.ring-wrap {
  display: grid;
  place-items: center;
  padding: 0.5rem 0 0.25rem;
}

.ring {
  --p: 0;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, #fff 72%, transparent 73% 100%),
    conic-gradient(var(--citrus) calc(var(--p) * 1%), rgba(26,43,76,0.12) 0);
  display: grid;
  place-items: center;
}

.ring span {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.table {
  --bs-table-bg: #fff;
  --bs-table-striped-bg: #F8F9FC;
  --bs-table-hover-bg: rgba(245, 166, 35, 0.08);
}

.table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  border-bottom-color: var(--line) !important;
}

.table tbody td {
  border-color: var(--line) !important;
  vertical-align: middle;
}

.badge-soft {
  background: rgba(39, 174, 96, 0.15);
  color: var(--success);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-weight: 650;
  font-size: 0.75rem;
}

.badge-due {
  background: rgba(231, 76, 60, 0.12);
  color: var(--danger);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-weight: 650;
  font-size: 0.75rem;
}

.badge-risk-med {
  background: rgba(245, 166, 35, 0.18);
  color: var(--citrus-deep);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-weight: 650;
  font-size: 0.75rem;
}

.btn-approve, .btn-success-soft {
  background: var(--success);
  color: #fff !important;
  border: 0;
  border-radius: 12px;
  padding: 0.45rem 0.9rem;
  font-weight: 650;
}
.btn-approve:hover, .btn-success-soft:hover { filter: brightness(0.95); color: #fff !important; }
.btn-reject, .btn-danger-soft {
  background: var(--danger);
  color: #fff !important;
  border: 0;
  border-radius: 12px;
  padding: 0.45rem 0.9rem;
  font-weight: 650;
}
.btn-reject:hover, .btn-danger-soft:hover { filter: brightness(0.95); color: #fff !important; }
.btn-edit-soft {
  background: var(--citrus);
  color: var(--navy) !important;
  border: 0;
  border-radius: 12px;
  padding: 0.45rem 0.9rem;
  font-weight: 650;
}
.btn-edit-soft:hover { background: var(--citrus-deep); color: #fff !important; }

/* ——— List / form workspace ——— */
.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 1rem;
  align-items: start;
}

.workspace-wide { grid-template-columns: 1fr; }

.panel-form .panel-h {
  background: linear-gradient(90deg, rgba(198, 232, 74, 0.18), transparent);
}

.panel-list .panel-h {
  background: rgba(255, 255, 255, 0.35);
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.code-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: rgba(12, 36, 28, 0.06);
  color: var(--ink-soft);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--ink-soft);
}

.empty-state .glyph {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--leaf-deep);
  background:
    radial-gradient(circle at 30% 30%, rgba(198, 232, 74, 0.55), transparent 55%),
    rgba(26, 107, 74, 0.08);
}

.empty-state strong {
  display: block;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.stock-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(12, 36, 28, 0.08);
  overflow: hidden;
  margin-top: 0.35rem;
  max-width: 88px;
}

.stock-bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--citrus-deep), var(--leaf));
}

.stock-bar.warn > i { background: linear-gradient(90deg, var(--coral), #f0a090); }

.table tbody tr {
  transition: background .15s ease;
}

.table tbody tr:hover {
  background: rgba(198, 232, 74, 0.12) !important;
}

.table td strong.product-name {
  font-weight: 650;
}

.form-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 0.85rem 0 0.55rem;
}

.pos-total-hint {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(12, 36, 28, 0.04);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.quick-action {
  text-decoration: none;
  color: var(--ink);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.8);
  transition: transform .2s, background .2s;
}

.quick-action:hover {
  transform: translateY(-2px);
  background: #fff;
  color: var(--ink);
}

.quick-action strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.quick-action span { font-size: 0.8rem; color: var(--ink-soft); }

.low-stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.low-stock-item:last-child { border-bottom: 0; }

.mobile-toggle {
  display: none;
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.row-actions a,
.row-actions button {
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  cursor: pointer;
}

.row-actions a:hover,
.row-actions button:hover {
  background: #fff;
  border-color: var(--leaf);
  color: var(--ink);
}

.row-actions .danger {
  color: #a03d2f;
  border-color: rgba(226, 109, 90, 0.35);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
}

.detail-item span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.detail-item strong {
  font-size: 1rem;
  font-weight: 650;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .detail-grid { grid-template-columns: 1fr; }
}

@keyframes rise {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

@keyframes drift {
  from { transform: rotate(-8deg) translateX(0); }
  to { transform: rotate(-4deg) translateX(18px); }
}

@media (max-width: 1100px) {
  .kpi-grid, .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .3s ease;
  }
  .admin-sidebar.open { transform: none; }
  .mobile-toggle { display: inline-flex; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 34vh; }
}

.product-photo-preview {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--mist);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-weight: 600;
}
.product-photo-preview img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block;
}
.product-thumb-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  background: var(--mist);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.product-thumb-sm.placeholder { border: 1px solid var(--line); }
.product-thumb-lg {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--line); background: var(--mist);
}

.product-stats { margin-bottom: 1rem; }
.product-manager .product-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.product-filters .form-label { font-size: 0.78rem; font-weight: 650; color: var(--ink-soft); margin-bottom: 0.25rem; }
.product-table .product-name { color: var(--navy); }
.product-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.product-actions .btn { font-size: 0.78rem; padding: 0.3rem 0.55rem; }
.product-pagination .pagination { gap: 0.25rem; }
.product-pagination .page-link {
  border-radius: 10px; border-color: var(--line); color: var(--navy); font-weight: 650;
}
.product-pagination .page-item.active .page-link {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.product-modal .modal-header {
  background: var(--navy); color: #fff; border-bottom: 0;
}
.product-modal .modal-title { font-family: var(--font-display); }
.product-modal .btn-close { filter: invert(1); }
.product-modal .modal-footer { border-top: 1px solid var(--line); background: #F8F9FC; }

/* Keep Bootstrap modals above admin shell / sidebar overlays */
.modal { z-index: 1080 !important; }
.modal-backdrop { z-index: 1070 !important; }
.modal.show .modal-dialog { pointer-events: auto; }
.modal-content { pointer-events: auto; }

/* Scrollable form modals (form is the modal-content) */
.modal-dialog-scrollable {
  max-height: calc(100vh - 1.5rem);
  margin: 0.75rem auto;
}
.modal-dialog-scrollable .modal-content.modal-form,
.modal-dialog-scrollable .modal-content.product-modal,
.modal-dialog-scrollable > .modal-content {
  max-height: calc(100vh - 1.5rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  max-height: 100%;
}
.modal-dialog-scrollable .modal-header,
.modal-dialog-scrollable .modal-footer {
  flex-shrink: 0;
}
.modal-dialog-scrollable .modal-body {
  overflow-y: auto !important;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Tom Select — searchable dropdowns */
.ts-wrapper.form-select,
.ts-wrapper.single.form-select {
  padding: 0;
  border: 0;
  background: transparent;
  height: auto;
  min-height: calc(1.5em + 0.75rem + 2px);
}
.ts-wrapper .ts-control {
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: #fff;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.35rem 0.65rem;
  box-shadow: none;
  font-size: 0.9375rem;
}
.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
  border-color: var(--navy);
  box-shadow: 0 0 0 0.2rem rgba(26, 43, 76, 0.15);
}
.ts-wrapper .ts-control input {
  font-size: 0.9375rem !important;
}
.ts-dropdown {
  z-index: 2000 !important;
  border-color: var(--line);
  border-radius: 0.375rem;
  box-shadow: 0 8px 24px rgba(26, 43, 76, 0.12);
  font-size: 0.9rem;
}
.ts-dropdown .option.active,
.ts-dropdown .option:hover {
  background: var(--mist);
  color: var(--ink);
}
.ts-dropdown .option.selected {
  background: rgba(245, 166, 35, 0.18);
  color: var(--ink);
}
.ts-wrapper.plugin-clear_button .clear-button {
  color: var(--ink-soft);
}
.modal .ts-wrapper { width: 100%; }
.code-chip {
  display: inline-block; font-size: 0.72rem; font-weight: 650; color: var(--ink-soft);
  background: var(--mist); border-radius: 6px; padding: 0.1rem 0.4rem; margin-right: 0.25rem;
}
.stock-bar {
  height: 4px; background: var(--mist); border-radius: 999px; margin-top: 0.35rem; overflow: hidden; max-width: 72px;
}
.stock-bar i { display: block; height: 100%; background: var(--success); border-radius: inherit; }
.stock-bar.warn i { background: var(--danger); }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--citrus-deep) !important; }

/* Bulk transfers */
.transfer-builder .transfer-route-arrow { min-height: 2.5rem; }
.transfer-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  background: var(--mist); color: var(--navy); font-weight: 700;
}
.transfer-lines-wrap {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
}
.transfer-lines-table thead th {
  background: #F8F9FC; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--ink-soft); border-bottom: 1px solid var(--line);
}
.transfer-lines-table td { vertical-align: middle; }
.transfer-route-chip {
  display: inline-block; font-size: 0.82rem; background: var(--mist);
  border-radius: 6px; padding: 0.15rem 0.45rem;
}
@media (max-width: 767.98px) {
  .transfer-route-arrow { display: none !important; }
}

/* Reports */
.report-charts .chart-wrap-sm { height: 180px; }
.report-bar {
  height: 6px; background: var(--mist); border-radius: 999px; overflow: hidden;
  max-width: 120px; display: inline-block; vertical-align: middle; margin-right: 0.35rem; width: 80px;
}
.report-bar i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--citrus), var(--navy));
  border-radius: inherit; min-width: 2px;
}



