:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #182033;
  --muted: #647084;
  --line: #dce2ec;
  --brand: #1d4ed8;
  --brand-dark: #173ea8;
  --danger: #b42318;
  --good: #157347;
  --warn: #b7791f;
  --shadow: 0 14px 34px rgba(24, 32, 51, .09);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text)} .hidden{display:none!important}.hidden-frame{width:0;height:0;border:0;position:absolute;left:-9999px}
.login-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top left,rgba(29,78,216,.24),transparent 28rem),linear-gradient(135deg,#0f172a,#1e3a8a)}
.login-card{width:min(460px,100%);background:#fff;border-radius:24px;padding:28px;box-shadow:0 24px 70px rgba(0,0,0,.24);display:grid;gap:14px}.login-card h1{margin:0}.login-card p{margin:0 0 6px;color:var(--muted)}.login-note{color:var(--muted);line-height:1.45}.brand-mark{width:62px;height:62px;border-radius:18px;background:var(--brand);color:#fff;display:grid;place-items:center;font-size:24px;font-weight:900}
.app-header{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;padding:28px;background:linear-gradient(135deg,#0f172a,#1d4ed8);color:#fff}.app-header h1{margin:4px 0 8px;font-size:clamp(28px,4vw,44px);line-height:1}.app-header p{margin:0;max-width:860px;color:rgba(255,255,255,.82)}.eyebrow{text-transform:uppercase;letter-spacing:.14em;font-weight:800;font-size:12px;color:rgba(255,255,255,.72)}.header-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.layout{display:grid;grid-template-columns:250px 1fr;min-height:calc(100vh - 140px)}.sidebar{padding:18px;border-right:1px solid var(--line);background:#fff}.nav-btn{display:block;width:100%;border:0;background:transparent;padding:12px 14px;margin-bottom:8px;border-radius:12px;color:var(--muted);font-weight:750;text-align:left;cursor:pointer}.nav-btn:hover,.nav-btn.active{background:#eaf1ff;color:var(--brand)}.content{padding:22px;overflow:auto}.tab{display:none}.tab.active{display:block}
.grid{display:grid;gap:18px}.grid.two{grid-template-columns:minmax(320px,500px) 1fr}.cards{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:16px;margin-bottom:18px}.card{background:var(--panel);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:18px}.card.narrow{max-width:720px}.stat span{display:block;color:var(--muted);font-weight:700;margin-bottom:10px}.stat strong{font-size:30px;letter-spacing:-.03em}
.user-strip{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px 14px;margin-bottom:14px;color:var(--muted)}.sync-banner{background:#eef6ff;border:1px solid #b9d9ff;color:#123b67;border-radius:16px;padding:12px 14px;margin-bottom:16px}.sync-banner.good{background:#eaf8f0;border-color:#b8e7ca;color:#0f5132}.sync-banner.warn{background:#fff7df;border-color:#f6dc8f;color:#6b4b00}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.section-title h2{margin:0;font-size:20px}.section-title span{color:var(--muted);font-size:13px}.form{display:grid;gap:12px}label{display:grid;gap:6px;font-weight:750;color:#334155;font-size:14px}.checkbox-line{display:flex;gap:10px;align-items:flex-start;font-weight:700;line-height:1.45}.checkbox-line input{width:auto;margin-top:4px}
input,textarea,select{width:100%;border:1px solid var(--line);border-radius:12px;padding:11px 12px;font:inherit;background:#fff;color:var(--text)}input:focus,textarea:focus,select:focus{outline:3px solid rgba(29,78,216,.14);border-color:var(--brand)}
.btn{border:0;border-radius:12px;padding:11px 14px;font-weight:800;cursor:pointer;font:inherit;text-decoration:none;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.btn.primary{background:var(--brand);color:#fff}.btn.primary:hover{background:var(--brand-dark)}.btn.primary-light{background:#fff;color:var(--brand);border:1px solid rgba(255,255,255,.35)}.btn.secondary{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.3)}.btn.secondary.solid,.card .btn.secondary{background:#edf2ff;color:var(--brand);border:1px solid #c7d7fe}.btn.danger{background:rgba(180,35,24,.12);color:#fff;border:1px solid rgba(255,255,255,.28)}.btn.danger.solid,.card .btn.danger,.filters .btn.danger{color:var(--danger);background:#fff0ee;border:1px solid #ffc9c2}.btn.small{padding:8px 10px;font-size:13px}.btn:disabled{opacity:.5;cursor:not-allowed}
.file-label input{display:none}.form-actions{display:flex;gap:10px;flex-wrap:wrap}.search{max-width:320px}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:820px}th,td{text-align:left;border-bottom:1px solid var(--line);padding:12px 10px;vertical-align:top}th{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;background:#f8fafc}td small{color:var(--muted);display:block;margin-top:3px}
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 9px;font-weight:800;font-size:12px}.badge.in,.badge.ok,.badge.paid,.badge.received{color:var(--good);background:#eaf8f0}.badge.out,.badge.cancelled{color:var(--danger);background:#fff0ee}.badge.low,.badge.draft,.badge.ordered,.badge.confirmed{color:var(--warn);background:#fff7df}.row-actions{display:flex;gap:8px;flex-wrap:wrap}.list{display:grid;gap:10px}.list-item{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fbfdff}.list-item strong{display:block}.list-item small{color:var(--muted)}.empty{color:var(--muted)}.filters{display:flex;gap:10px;margin-bottom:12px;align-items:center}.filters select{max-width:200px}
.toast{position:fixed;right:18px;bottom:18px;background:#0f172a;color:#fff;padding:12px 14px;border-radius:12px;box-shadow:var(--shadow);display:none;max-width:380px;z-index:100}.toast.show{display:block}.sync-status{margin-top:16px;padding:12px;border:1px solid var(--line);background:#fbfdff;border-radius:14px;color:var(--muted)}.steps{margin-top:0;padding-left:22px;line-height:1.7}.note{color:var(--muted);line-height:1.55;margin-bottom:0}.permission-box{border:1px solid var(--line);border-radius:14px;padding:12px;display:grid;gap:8px;background:#fbfdff}.report-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}.image-preview{width:140px;height:110px;object-fit:cover;border-radius:16px;border:1px solid var(--line);background:#f8fafc}.thumb{width:54px;height:46px;object-fit:cover;border-radius:10px;border:1px solid var(--line);background:#f8fafc}.thumb-placeholder{width:54px;height:46px;border-radius:10px;border:1px dashed var(--line);display:grid;place-items:center;color:var(--muted);font-size:11px;background:#fbfdff}.file-link{font-weight:800;color:var(--brand);text-decoration:none}.alert-actions{margin-top:14px}
[data-locked="true"]{opacity:.65}
@media(max-width:1100px){.app-header,.layout,.grid.two,.cards{grid-template-columns:1fr}.app-header{display:grid}.header-actions{justify-content:flex-start}.layout{display:block}.sidebar{display:flex;overflow-x:auto;gap:8px;position:sticky;top:0;z-index:5}.nav-btn{white-space:nowrap;width:auto;margin:0}.content{padding:14px}table{min-width:900px}}
@media print{.app-header,.sidebar,.header-actions,.no-print{display:none!important}.layout{display:block}.content{padding:0}.card{box-shadow:none;border:0}.tab{display:block}}


/* v4.2 responsive polish and smooth motion */
html { scroll-behavior: smooth; }
body { animation: appFadeIn .28s ease-out both; }
@keyframes appFadeIn { from { opacity: 0; } to { opacity: 1; } }
.tab.active { animation: tabSlideIn .28s ease-out both; }
@keyframes tabSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card, .nav-btn, .btn, input, textarea, select, .list-item, tr { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease; }
.card:hover { box-shadow: 0 18px 42px rgba(24, 32, 51, .12); }
.nav-btn:hover, .btn:hover { transform: translateY(-1px); }
input:hover, textarea:hover, select:hover { border-color: #b7c5dc; }
tbody tr:hover { background: #f8fbff; }
.stockout-grid { grid-template-columns: minmax(320px, 480px) minmax(420px, 1fr); align-items: start; }
.stockout-list-card { min-width: 0; }
.stack-title { align-items: flex-start; }
.stack-title > div { display: grid; gap: 4px; }
.stockout-filters { display: grid; grid-template-columns: 1.5fr 1fr 1fr .8fr .8fr; gap: 12px; align-items: end; margin-bottom: 12px; }
.search.wide { max-width: none; }
.mini-summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 12px; padding: 10px 12px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); color: var(--muted); font-weight: 750; }
.mini-summary strong { color: var(--text); }
.stockout-table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
.stockout-table { min-width: 980px; }
.stockout-table thead th { position: sticky; top: 0; z-index: 2; }
.stockout-person { font-weight: 800; }
.stockout-purpose { max-width: 240px; }
.stockout-note { max-width: 260px; }
@media (max-width: 1280px) {
  .stockout-grid { grid-template-columns: 1fr; }
  .stockout-form-card { max-width: none; }
}
@media (max-width: 760px) {
  .app-header { padding: 20px 16px; }
  .header-actions { gap: 8px; }
  .btn { width: auto; min-height: 42px; }
  .content { padding: 12px; }
  .card { padding: 14px; border-radius: 18px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .stockout-filters { grid-template-columns: 1fr; }
  .stockout-table-wrap { max-height: none; border: 0; overflow: visible; }
  .stockout-table { min-width: 0; border-collapse: separate; border-spacing: 0 12px; }
  .stockout-table thead { display: none; }
  .stockout-table, .stockout-table tbody, .stockout-table tr, .stockout-table td { display: block; width: 100%; }
  .stockout-table tr { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: 0 8px 22px rgba(24, 32, 51, .06); }
  .stockout-table td { border: 0; padding: 7px 0; display: grid; grid-template-columns: 115px 1fr; gap: 10px; }
  .stockout-table td::before { content: attr(data-label); color: var(--muted); font-weight: 850; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  .mini-summary { display: grid; gap: 6px; }
  .sidebar { padding: 12px; }
  .nav-btn { padding: 10px 12px; }
  input, textarea, select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* v4.4 JK red / white / black theme + stock-out list fix */
:root {
  --bg: #f6f6f7;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5b6473;
  --line: #e4e4e7;
  --brand: #d71920;
  --brand-dark: #a80f15;
  --brand-soft: #fff1f2;
  --black: #0a0a0b;
  --danger: #d71920;
  --good: #087f5b;
  --warn: #b7791f;
  --shadow: 0 18px 50px rgba(10, 10, 11, .10);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(215,25,32,.08), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, #f6f6f7 38%, #f0f1f3 100%);
  animation: appFadeIn .32s ease-out both;
}

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

.login-screen {
  background:
    radial-gradient(circle at top left, rgba(215,25,32,.30), transparent 26rem),
    linear-gradient(135deg, #050505, #151515 56%, #d71920);
}

.brand-mark {
  background: linear-gradient(135deg, #d71920, #8f0c12);
  box-shadow: 0 14px 30px rgba(215,25,32,.28);
}

.app-header {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.20), transparent 28rem),
    linear-gradient(135deg, #050505, #171717 58%, #d71920);
  border-bottom: 4px solid #d71920;
}

.app-header p {
  color: rgba(255,255,255,.78);
}

.layout {
  background: transparent;
}

.sidebar {
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(12px);
  border-right: 1px solid #e5e7eb;
}

.nav-btn {
  color: #4b5563;
  border: 1px solid transparent;
}

.nav-btn:hover,
.nav-btn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  box-shadow: 0 10px 24px rgba(17,24,39,.16);
}

.card {
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 24px 62px rgba(10,10,11,.13);
}

.section-title h2 {
  color: #111827;
  letter-spacing: -.02em;
}

.section-title span,
.note,
.login-note,
.sync-status,
.list-item small,
td small {
  color: #6b7280;
}

input,
textarea,
select {
  border: 1px solid #d9dce2;
  background: #fff;
  border-radius: 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 4px solid rgba(215,25,32,.13);
  border-color: #d71920;
}

.btn {
  border-radius: 14px;
}

.btn.primary,
.btn.primary-light {
  background: linear-gradient(135deg, #d71920, #a80f15);
  color: #fff;
  border: 1px solid rgba(215,25,32,.24);
  box-shadow: 0 10px 22px rgba(215,25,32,.20);
}

.btn.primary:hover,
.btn.primary-light:hover {
  background: linear-gradient(135deg, #b81218, #84090e);
}

.btn.secondary.solid,
.card .btn.secondary {
  background: #111827;
  color: #fff;
  border: 1px solid #111827;
}

.btn.secondary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
}

.btn.danger.solid,
.card .btn.danger,
.filters .btn.danger {
  color: #d71920;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.badge.out,
.badge.cancelled,
.badge.low {
  color: #9f0712;
  background: #fff1f2;
}

.badge.in,
.badge.ok,
.badge.paid,
.badge.received {
  color: #047857;
  background: #ecfdf5;
}

.sync-banner {
  background: #111827;
  border: 1px solid #111827;
  color: #fff;
  box-shadow: 0 14px 34px rgba(17,24,39,.16);
}

.sync-banner.good {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.sync-banner.warn {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f0712;
}

.sync-banner.compact {
  margin-bottom: 14px;
}

.user-strip {
  border: 0;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(10,10,11,.07);
}

.stat {
  position: relative;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #d71920, #111827);
}

.stat strong {
  color: #111827;
}

.table-wrap {
  border-radius: 18px;
}

th {
  background: #111827;
  color: #ffffff;
}

tbody tr:hover {
  background: #fff7f7;
}

/* Smooth transitions */
.tab.active {
  animation: tabSlideIn .28s ease-out both;
}

@keyframes tabSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card,
.nav-btn,
.btn,
input,
textarea,
select,
.list-item,
tr {
  transition:
    transform .20s ease,
    box-shadow .20s ease,
    background-color .20s ease,
    border-color .20s ease,
    color .20s ease,
    opacity .20s ease;
}

.nav-btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

input:hover,
textarea:hover,
select:hover {
  border-color: #b8bdc8;
}

/* Stock-out page */
.stockout-grid {
  grid-template-columns: minmax(340px, 600px) minmax(460px, 1fr);
  align-items: start;
  gap: 24px;
}

.stockout-form-card,
.stockout-list-card {
  min-width: 0;
}

.stockout-list-card {
  background:
    linear-gradient(180deg, rgba(255,241,242,.55), rgba(255,255,255,1) 38%),
    #fff;
}

.stack-title {
  align-items: flex-start;
}

.stack-title > div {
  display: grid;
  gap: 4px;
}

.stockout-filters {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr .85fr .85fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.search.wide {
  max-width: none;
}

.mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
  font-weight: 800;
}

.mini-summary strong {
  color: #ffffff;
}

.stockout-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
}

.stockout-table {
  min-width: 980px;
}

.stockout-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.stockout-person {
  font-weight: 900;
  color: #111827;
}

.stockout-purpose,
.stockout-note {
  max-width: 260px;
}

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

  .stockout-form-card {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .app-header {
    padding: 20px 16px;
  }

  .content {
    padding: 12px;
  }

  .card {
    padding: 14px;
    border-radius: 20px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .stockout-filters {
    grid-template-columns: 1fr;
  }

  .stockout-table-wrap {
    max-height: none;
    border: 0;
    overflow: visible;
    background: transparent;
  }

  .stockout-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .stockout-table thead {
    display: none;
  }

  .stockout-table,
  .stockout-table tbody,
  .stockout-table tr,
  .stockout-table td {
    display: block;
    width: 100%;
  }

  .stockout-table tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #d71920;
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 10px 28px rgba(10,10,11,.08);
  }

  .stockout-table td {
    border: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
  }

  .stockout-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .mini-summary {
    display: grid;
    gap: 6px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .layout {
    display: block;
  }

  .sidebar {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .nav-btn {
    width: auto;
    white-space: nowrap;
    margin: 0;
    padding: 10px 12px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions .btn,
  .header-actions .file-label {
    flex: 1 1 140px;
  }

  .stockout-table td {
    grid-template-columns: 105px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}


/* v4.5 raw materials + employee journey */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
  margin: 18px 0;
}

.journey-grid {
  grid-template-columns: minmax(360px, 560px) minmax(520px, 1fr);
  align-items: start;
  gap: 24px;
}

.journey-form-card,
.journey-list-card {
  min-width: 0;
}

.journey-list-card {
  background:
    linear-gradient(180deg, rgba(255,241,242,.58), rgba(255,255,255,1) 38%),
    #fff;
}

.journey-filters {
  display: grid;
  grid-template-columns: 1.35fr 1fr .8fr .8fr .8fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.journey-table-wrap {
  max-height: 610px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
}

.journey-table {
  min-width: 1180px;
}

.journey-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .02em;
}

.status-pill.taken {
  color: #9f0712;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.status-pill.complete {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.raw-stock-warning {
  color: #9f0712;
  font-weight: 900;
}

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

@media (max-width: 900px) {
  .journey-filters {
    grid-template-columns: 1fr;
  }

  .journey-table-wrap {
    max-height: none;
    border: 0;
    overflow: visible;
    background: transparent;
  }

  .journey-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .journey-table thead {
    display: none;
  }

  .journey-table,
  .journey-table tbody,
  .journey-table tr,
  .journey-table td {
    display: block;
    width: 100%;
  }

  .journey-table tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #d71920;
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 10px 28px rgba(10,10,11,.08);
  }

  .journey-table td {
    border: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
  }

  .journey-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
}


/* v4.6 employee master, searchable inputs, raw stock-in fixes */
.hidden-select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

input[list] {
  background-image: linear-gradient(45deg, transparent 50%, #111827 50%), linear-gradient(135deg, #111827 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.form .btn.primary {
  min-height: 48px;
}

.employee-chip {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff1f2;
  color: #9f0712;
  font-weight: 900;
  border: 1px solid #fecdd3;
}

.grid.two .card[data-permission="manageStock"] + .card {
  min-width: 0;
}

@media (max-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr !important;
  }

  .table-wrap table {
    min-width: 760px;
  }
}


/* v4.7 bulk CSV/XLSX import */
.bulk-import-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: start;
  gap: 24px;
}

.bulk-result-card {
  grid-column: 1 / -1;
}

.import-panel {
  display: grid;
  gap: 14px;
}

.import-note {
  margin: 0;
  color: #5b6473;
  line-height: 1.55;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 750;
}

.bulk-result {
  display: grid;
  gap: 10px;
  min-height: 90px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 14px;
}

.bulk-result.empty {
  color: #6b7280;
}

.result-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #f0f0f2;
  padding-bottom: 10px;
}

.result-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.result-pill {
  display: inline-flex;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  padding: 5px 10px;
  font-weight: 900;
  font-size: 12px;
}

.result-pill.red {
  background: #d71920;
}

.supported-fields {
  margin-top: 14px;
  color: #5b6473;
  line-height: 1.55;
}

.supported-fields h3 {
  margin: 12px 0 4px;
  color: #111827;
  font-size: 16px;
}

.supported-fields p {
  margin: 0;
}

@media (max-width: 900px) {
  .bulk-import-grid {
    grid-template-columns: 1fr;
  }
}


/* v4.8 unified employee journey */
.unified-journey-grid {
  grid-template-columns: minmax(360px, 600px) minmax(620px, 1fr);
}

.unified-journey-filters {
  grid-template-columns: 1.3fr 1fr .8fr .8fr .8fr .8fr;
}

.unified-journey-table {
  min-width: 1280px;
}

.item-type-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #e5e7eb;
  background: #111827;
  color: #fff;
}

.item-type-pill.raw {
  background: #fff1f2;
  color: #9f0712;
  border-color: #fecdd3;
}

.item-type-pill.product {
  background: #111827;
  color: #fff;
}

.employee-source-note {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .unified-journey-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .unified-journey-filters {
    grid-template-columns: 1fr;
  }

  .unified-journey-table {
    min-width: 0;
  }
}


/* v4.9 suppliers and no-sales cleanup */
.supplier-help-card {
  background:
    linear-gradient(180deg, rgba(255,241,242,.64), rgba(255,255,255,1) 44%),
    #fff;
}

.supplier-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  background: #111827;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

input[list]::-webkit-calendar-picker-indicator {
  opacity: .9;
}


/* v5.0 unfinished jobs tracker */
.jobs-board-card {
  background:
    linear-gradient(180deg, rgba(255,241,242,.60), rgba(255,255,255,1) 34%),
    #ffffff;
}

.jobs-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin: 14px 0 16px;
}

.job-stat {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(10,10,11,.06);
  position: relative;
  overflow: hidden;
}

.job-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #111827;
}

.job-stat.open::before,
.job-stat.waste::before {
  background: #d71920;
}

.job-stat.complete::before {
  background: #047857;
}

.job-stat span {
  display: block;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: 8px;
}

.job-stat strong {
  display: block;
  color: #111827;
  font-size: 30px;
  line-height: 1;
}

.job-filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr .8fr .8fr .8fr .8fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.job-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.job-column {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 22px;
  padding: 14px;
  min-height: 220px;
}

.job-column-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.job-column-title h3 {
  margin: 0;
  color: #111827;
}

.job-column-title span {
  color: #6b7280;
  font-weight: 900;
}

.job-list {
  display: grid;
  gap: 12px;
}

.job-card {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(10,10,11,.07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(10,10,11,.12);
  border-color: #fecdd3;
}

.job-card.open {
  border-left: 5px solid #d71920;
}

.job-card.complete {
  border-left: 5px solid #047857;
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.job-card h4 {
  margin: 0;
  color: #111827;
  font-size: 18px;
}

.job-card small {
  color: #6b7280;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.job-meta div {
  border-radius: 12px;
  background: #f9fafb;
  padding: 8px 10px;
  color: #374151;
  font-weight: 750;
}

.job-meta span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.job-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

@media (max-width: 1200px) {
  .job-columns,
  .jobs-stats,
  .job-filters {
    grid-template-columns: 1fr;
  }
}


/* v5.2 zero-waste intelligence modules */
.zero-panel {
  background:
    radial-gradient(circle at top right, rgba(215,25,32,.08), transparent 28rem),
    linear-gradient(180deg, rgba(255,241,242,.48), #fff 42%),
    #fff;
}

.zero-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.zero-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(10,10,11,.06);
  position: relative;
  overflow: hidden;
}

.zero-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #111827;
}

.zero-stat.waste::before,
.zero-stat.open::before {
  background: #d71920;
}

.zero-stat.complete::before {
  background: #047857;
}

.zero-stat span {
  display: block;
  color: #6b7280;
  font-weight: 900;
  margin-bottom: 8px;
}

.zero-stat strong {
  font-size: 30px;
  color: #111827;
  line-height: 1;
}

.inner-card {
  box-shadow: 0 10px 28px rgba(10,10,11,.06);
}

.score-filters {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.score-list {
  display: grid;
  gap: 12px;
}

.score-card {
  border: 1px solid #e5e7eb;
  border-left: 5px solid #111827;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(10,10,11,.06);
  transition: transform .20s ease, box-shadow .20s ease, border-color .20s ease;
}

.score-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(10,10,11,.12);
  border-color: #fecdd3;
}

.score-card.warn {
  border-left-color: #d71920;
}

.score-card.good {
  border-left-color: #047857;
}

.score-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.score-card h3,
.score-card h4 {
  margin: 0;
  color: #111827;
}

.score-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.score-metrics div {
  background: #f9fafb;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 850;
}

.score-metrics span {
  display: block;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
  font-weight: 900;
}

.reorder-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.reorder-item .btn {
  min-width: 110px;
}

#reminderPreview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.5;
  min-height: 260px;
}

@media (max-width: 1280px) {
  .zero-stats,
  .score-metrics {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 900px) {
  .zero-stats,
  .score-filters,
  .score-metrics {
    grid-template-columns: 1fr;
  }

  .reorder-item {
    grid-template-columns: 1fr;
  }
}


/* v5.3 batch, wastage reason, supplier history */
.batch-filters,
.supplier-history-filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr .8fr .8fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.batch-list {
  display: grid;
  gap: 14px;
}

.batch-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 5px solid #d71920;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(10,10,11,.07);
  transition: transform .20s ease, box-shadow .20s ease, border-color .20s ease;
}

.batch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(10,10,11,.13);
  border-color: #fecdd3;
}

.batch-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.batch-top h3 {
  margin: 0;
  color: #111827;
}

.batch-number {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 11px;
  background: #111827;
  color: #fff;
  font-weight: 950;
  letter-spacing: .02em;
}

.batch-detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.batch-detail-grid div {
  border-radius: 12px;
  padding: 8px 10px;
  background: #f9fafb;
  font-weight: 850;
}

.batch-detail-grid span {
  display: block;
  color: #6b7280;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.defect-box {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f0712;
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 10px;
  font-weight: 850;
}

.supplier-score {
  border-left-color: #111827;
}

.supplier-score.good {
  border-left-color: #047857;
}

.supplier-score.warn {
  border-left-color: #d71920;
}

.quality-stars {
  font-weight: 950;
  color: #d71920;
  letter-spacing: .05em;
}

@media (max-width: 1280px) {
  .batch-detail-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 900px) {
  .batch-filters,
  .supplier-history-filters,
  .batch-detail-grid {
    grid-template-columns: 1fr;
  }

  .batch-top {
    display: grid;
  }
}


/* v5.4 product stock merge, raw material full screen, raw image upload */
.products-stock-wrap {
  margin-top: 24px;
}

.product-stock-card {
  max-width: none;
}

.raw-full-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.raw-full-layout > .card {
  min-width: 0;
}

.raw-image-preview {
  min-height: 120px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 850;
  overflow: hidden;
}

.raw-image-preview img {
  max-width: 100%;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.raw-thumb {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: block;
}

.raw-thumb-empty {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px dashed #d1d5db;
  display: grid;
  place-items: center;
  color: #9ca3af;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .raw-full-layout {
    grid-template-columns: 1fr;
  }
}


/* v5.5 fixed searchable dropdown logic */
.jk-smart-dropdown {
  position: fixed;
  z-index: 99999;
  max-height: 280px;
  overflow: auto;
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(10,10,11,.35);
  padding: 6px;
}
.jk-smart-option { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 900; transition: background-color .16s ease, transform .16s ease; }
.jk-smart-option:hover, .jk-smart-option.active { background: #d71920; transform: translateX(2px); }
.jk-smart-option small { color: rgba(255,255,255,.78); font-weight: 750; }
.jk-smart-empty { padding: 12px; color: rgba(255,255,255,.72); font-weight: 850; }
input.jk-dropdown-active { outline: 4px solid rgba(215,25,32,.14); border-color: #d71920; }
@media (max-width: 760px) { .jk-smart-dropdown { left: 12px !important; right: 12px !important; width: auto !important; max-height: 320px; } }


/* v5.6 section repair + real custom dropdowns */
.products-stock-wrap {
  margin-top: 24px;
}

.product-stock-card {
  max-width: none;
}

.raw-full-layout {
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.raw-full-layout > .card {
  min-width: 0;
}

.jk-smart-dropdown {
  position: fixed;
  z-index: 999999;
  max-height: 320px;
  overflow: auto;
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(10,10,11,.38);
  padding: 6px;
}

.jk-smart-option {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  transition: background-color .16s ease, transform .16s ease;
}

.jk-smart-option:hover,
.jk-smart-option.active {
  background: #d71920;
  transform: translateX(2px);
}

.jk-smart-option small {
  color: rgba(255,255,255,.78);
  font-weight: 750;
}

.jk-smart-empty {
  padding: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 850;
}

input.jk-dropdown-active {
  outline: 4px solid rgba(215,25,32,.14);
  border-color: #d71920;
}

.raw-image-preview {
  min-height: 120px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 850;
  overflow: hidden;
}

.raw-image-preview img {
  max-width: 100%;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.raw-thumb {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: block;
}

.raw-thumb-empty {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px dashed #d1d5db;
  display: grid;
  place-items: center;
  color: #9ca3af;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .raw-full-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .jk-smart-dropdown {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
  }
}


/* v5.7 navigation repair */
.nav-btn {
  user-select: none;
}

.nav-btn.active {
  background: #111827 !important;
  color: #fff !important;
  box-shadow: 0 12px 30px rgba(10,10,11,.14);
}


/* v5.8 create-missing dropdown options */
.jk-smart-option.create {
  background: #d71920;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}

.jk-smart-option.create small {
  color: rgba(255,255,255,.88);
}


/* v5.9 FINAL: stop floating dropdowns; inline only */
#jkSmartDropdown,
.jk-smart-dropdown {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.form label,
.journey-filters label,
.job-filters label,
.score-filters label,
.batch-filters label,
.supplier-history-filters label,
.import-panel label,
.zero-panel label,
.inner-card label {
  position: relative;
}

.jk-dropdown-host {
  position: relative !important;
  z-index: 50;
}

.jk-inline-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  z-index: 99999;
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(10,10,11,.30);
  padding: 6px;
}

.tab:not(.active) .jk-inline-dropdown {
  display: none !important;
}

.jk-smart-option {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  transition: background-color .16s ease, transform .16s ease;
}

.jk-smart-option:hover,
.jk-smart-option.active {
  background: #d71920;
  transform: translateX(2px);
}

.jk-smart-option.create {
  background: #d71920;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}

.jk-smart-option small {
  color: rgba(255,255,255,.78);
  font-weight: 750;
}

.jk-smart-empty {
  padding: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 850;
}

input.jk-dropdown-active {
  outline: 4px solid rgba(215,25,32,.14);
  border-color: #d71920;
}


/* v6.0 purchase order stability */
#purchaseorders .card {
  min-width: 0;
}

#purchaseorders .table-wrap {
  min-height: 180px;
}


/* v6.1 purchase order multi-select */
.po-multi-box {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.po-line-grid {
  display: grid;
  grid-template-columns: .8fr 1.5fr .7fr .8fr auto;
  gap: 12px;
  align-items: end;
}

.po-add-line-btn {
  min-height: 52px;
  white-space: nowrap;
}

.po-lines-wrap {
  margin-top: 12px;
  max-height: 260px;
}

.item-type-pill.product {
  background: #111827;
  color: #fff;
}

.item-type-pill.raw {
  background: #d71920;
  color: #fff;
}

@media (max-width: 1100px) {
  .po-line-grid {
    grid-template-columns: 1fr 1fr;
  }

  .po-add-line-btn {
    grid-column: 1 / -1;
  }
}

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


/* v6.2 Purchase Order layout and dropdown repair */
#purchaseorders.purchase-orders-page {
  overflow: visible;
}

#purchaseorders .po-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  overflow: visible;
}

#purchaseorders .card {
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow: visible;
}

#purchaseorders .po-multi-box {
  overflow: visible;
  position: relative;
}

.po-helper-note {
  margin: 0 0 12px;
  color: #6b7280;
  font-weight: 800;
  line-height: 1.45;
}

#purchaseorders .po-line-grid {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(260px, 2fr) minmax(120px, .65fr) minmax(130px, .7fr) minmax(130px, auto);
  gap: 12px;
  align-items: end;
  width: 100%;
  overflow: visible;
}

#purchaseorders .po-line-grid label {
  min-width: 0;
  position: relative;
}

#purchaseorders .po-line-grid input,
#purchaseorders .po-line-grid select {
  width: 100%;
  min-width: 0;
}

#purchaseorders .po-add-line-btn {
  width: 100%;
  min-height: 52px;
  white-space: nowrap;
}

#purchaseorders .po-lines-wrap {
  margin-top: 14px;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

#purchaseorders .po-lines-wrap table {
  min-width: 760px;
}

#purchaseorders .jk-dropdown-host {
  z-index: 500;
}

#purchaseorders .jk-inline-dropdown {
  z-index: 100000;
  max-height: 260px;
}

#purchaseorders .table-wrap {
  max-width: 100%;
}

@media (max-width: 1150px) {
  #purchaseorders .po-line-grid {
    grid-template-columns: 1fr 1fr;
  }

  #purchaseorders .po-add-line-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  #purchaseorders .po-layout {
    gap: 16px;
  }

  #purchaseorders .po-line-grid {
    grid-template-columns: 1fr;
  }

  #purchaseorders .card {
    padding: 18px;
  }

  #purchaseorders .po-lines-wrap table {
    min-width: 680px;
  }
}


/* v6.3 universal full-width, no-crop, responsive layout pass */
:root {
  --jk-page-gap: 24px;
}

.app,
.app-shell,
.main,
.content,
section.content {
  min-width: 0;
}

section.content {
  overflow: visible !important;
}

.jk-page {
  width: 100%;
  max-width: none;
  overflow: visible !important;
  animation: jkFadeUp .22s ease;
}

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

.jk-page > .card,
.jk-page > .zero-panel,
.jk-page > .grid,
.jk-page > .jk-section-grid,
.jk-page > .raw-full-layout,
.jk-page > .po-layout {
  width: 100%;
  max-width: none;
}

.jk-section-grid,
.raw-full-layout,
.po-layout {
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(460px, 1.05fr);
  gap: var(--jk-page-gap);
  align-items: start;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  overflow: visible !important;
}

.po-layout {
  grid-template-columns: 1fr;
  max-width: 1480px;
}

.jk-section-grid > .card,
.raw-full-layout > .card,
.po-layout > .card,
.zero-panel,
.inner-card,
.card {
  min-width: 0;
}

.card,
.zero-panel,
.inner-card {
  overflow: visible !important;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 760px;
}

.form {
  min-width: 0;
}

.form label,
.job-filters label,
.score-filters label,
.batch-filters label,
.supplier-history-filters label,
.job-filters label,
.po-line-grid label,
.zero-panel label,
.inner-card label,
.card label {
  position: relative;
  min-width: 0;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

input,
select,
textarea {
  min-width: 0;
}

/* Uniform dropdown behavior across every section */
#jkSmartDropdown,
.jk-smart-dropdown {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.jk-dropdown-host {
  position: relative !important;
  z-index: 80;
}

.jk-inline-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 270px;
  overflow: auto;
  z-index: 100000;
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(10,10,11,.32);
  padding: 6px;
}

.tab:not(.active) .jk-inline-dropdown {
  display: none !important;
}

.jk-smart-option {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  transition: background-color .16s ease, transform .16s ease;
}

.jk-smart-option:hover,
.jk-smart-option.active {
  background: #d71920;
  transform: translateX(2px);
}

.jk-smart-option.create {
  background: #d71920;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}

.jk-smart-option small {
  color: rgba(255,255,255,.78);
  font-weight: 750;
}

.jk-smart-empty {
  padding: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 850;
}

input.jk-dropdown-active {
  outline: 4px solid rgba(215,25,32,.14);
  border-color: #d71920;
}

/* Full-width special sections */
#products .products-stock-wrap {
  width: 100%;
  max-width: 1480px;
  margin: 24px auto 0;
}

#purchaseorders .po-layout,
#closing .zero-panel,
#scorecard .zero-panel,
#jobs .zero-panel,
#reorder .zero-panel,
#reminders .zero-panel,
#batches .zero-panel,
#supplierhistory .zero-panel {
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
}

#purchaseorders .po-line-grid {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(280px, 2fr) minmax(130px, .65fr) minmax(140px, .7fr) minmax(140px, auto);
  gap: 12px;
  align-items: end;
  width: 100%;
  overflow: visible;
}

#purchaseorders .po-line-grid label {
  min-width: 0;
}

#purchaseorders .po-add-line-btn {
  width: 100%;
  min-height: 52px;
  white-space: nowrap;
}

#purchaseorders .po-lines-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

#purchaseorders .po-lines-wrap table {
  min-width: 780px;
}

/* Prevent wide dashboards/cards from pushing viewport */
.stats-grid,
.zero-stats,
.jobs-stats,
.score-metrics,
.job-columns,
.closing-grid {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 1280px) {
  .jk-section-grid,
  .raw-full-layout {
    grid-template-columns: 1fr;
  }

  #purchaseorders .po-line-grid {
    grid-template-columns: 1fr 1fr;
  }

  #purchaseorders .po-add-line-btn {
    grid-column: 1 / -1;
  }

  .zero-stats,
  .jobs-stats,
  .score-metrics {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  section.content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .jk-section-grid,
  .raw-full-layout,
  .po-layout {
    gap: 16px;
  }

  #purchaseorders .po-line-grid,
  .job-filters,
  .score-filters,
  .batch-filters,
  .supplier-history-filters,
  .zero-stats,
  .jobs-stats,
  .score-metrics,
  .job-columns,
  .closing-grid {
    grid-template-columns: 1fr !important;
  }

  .card,
  .zero-panel,
  .inner-card {
    padding: 18px;
    border-radius: 20px;
  }

  .table-wrap table {
    min-width: 680px;
  }
}

@media (max-width: 560px) {
  section.content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .card,
  .zero-panel,
  .inner-card {
    padding: 15px;
    border-radius: 18px;
  }

  .section-title,
  .stack-title,
  .job-column-title,
  .score-card-top,
  .batch-top {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  .form-actions,
  .row-actions,
  .job-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .form-actions .btn,
  .row-actions .btn,
  .job-actions .btn {
    width: 100%;
  }

  .jk-inline-dropdown {
    max-height: 240px;
  }
}


/* v6.4 received PO fix, full-width raw list, employee profiles, image uploads */
.po-row-received .btn.primary,
.po-row-received .receive-btn {
  display: none !important;
}

.received-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 13px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
  font-weight: 950;
}

.raw-list-full-wrap {
  width: 100%;
  max-width: 1480px;
  margin: 24px auto 0;
}

.raw-list-full-card {
  width: 100%;
  max-width: none;
}

#rawmaterials .raw-list-full-card .table-wrap table {
  min-width: 980px;
}

.profile-name-btn {
  border: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color .16s ease, transform .16s ease;
}

.profile-name-btn:hover {
  color: #d71920;
  transform: translateX(2px);
}

.profile-name-btn.inline {
  display: inline;
}

.profile-modal[hidden] {
  display: none !important;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,10,11,.58);
  backdrop-filter: blur(6px);
}

.profile-modal-card {
  position: relative;
  width: min(1120px, calc(100vw - 36px));
  max-height: min(88vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(10,10,11,.36);
  padding: 26px;
  animation: jkProfileIn .2s ease;
}

@keyframes jkProfileIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-close-btn {
  position: sticky;
  top: 0;
  float: right;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background: linear-gradient(135deg, #111827, #d71920);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 1000;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(10,10,11,.18);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero h2 {
  margin: 0 0 4px;
  color: #111827;
}

.profile-hero p {
  margin: 0;
  color: #6b7280;
  font-weight: 800;
}

.profile-score-badge {
  min-width: 120px;
  border-radius: 22px;
  padding: 14px;
  background: #111827;
  color: #fff;
  display: grid;
  gap: 2px;
  text-align: center;
}

.profile-score-badge span,
.profile-score-badge small {
  color: rgba(255,255,255,.78);
  font-weight: 850;
}

.profile-score-badge strong {
  font-size: 34px;
  line-height: 1;
}

.profile-score-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.profile-score-grid article {
  border-radius: 18px;
  background: #f9fafb;
  border: 1px solid #eef2f7;
  padding: 14px;
}

.profile-score-grid span {
  display: block;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 950;
  font-size: 12px;
  letter-spacing: .04em;
}

.profile-score-grid strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
  color: #111827;
}

.profile-rules,
.profile-work-section {
  border: 1px solid #eef2f7;
  border-radius: 22px;
  padding: 16px;
  margin-top: 14px;
  background: #fff;
}

.profile-rules h3,
.profile-work-section h3 {
  margin: 0 0 12px;
}

.score-rule-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 4px 8px 4px 0;
  padding: 8px 11px;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
  font-weight: 900;
}

.score-rule-row span {
  font-weight: 1000;
}

.score-rule-row.negative {
  background: #fff1f2;
  color: #b91c1c;
}

.profile-job-card {
  display: grid;
  gap: 4px;
  border-left: 4px solid #d71920;
  background: #f9fafb;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.profile-job-card.complete {
  border-left-color: #047857;
}

.profile-job-card span,
.profile-job-card small,
.muted {
  color: #6b7280;
  font-weight: 800;
}

.profile-image-preview {
  min-height: 110px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 850;
  overflow: hidden;
}

.profile-image-preview img {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  display: block;
}

.contact-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-profile-thumb {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 950;
  border: 1px solid #e5e7eb;
}

.small-profile-thumb.empty {
  background: #111827;
}

body.profile-modal-open {
  overflow: hidden;
}

@media (max-width: 1000px) {
  .profile-score-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .profile-hero {
    grid-template-columns: auto 1fr;
  }

  .profile-score-badge {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    text-align: left;
  }
}

@media (max-width: 650px) {
  .profile-modal {
    padding: 10px;
  }

  .profile-modal-card {
    width: calc(100vw - 20px);
    max-height: 92vh;
    padding: 18px;
    border-radius: 22px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .profile-score-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-avatar {
    width: 72px;
    height: 72px;
  }
}


/* v6.5 employee deadline timeline + score penalty */
.deadline-score-note {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f0712;
  font-weight: 850;
}

.deadline-pill,
.job-deadline-line {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 950;
  font-size: 12px;
  letter-spacing: .01em;
  margin-top: 4px;
}

.deadline-pill.none,
.job-deadline-line.none {
  background: #f3f4f6;
  color: #6b7280;
}

.deadline-pill.upcoming,
.job-deadline-line.upcoming {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.deadline-pill.today,
.job-deadline-line.today {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.deadline-pill.overdue,
.job-deadline-line.overdue {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  box-shadow: 0 8px 22px rgba(215,25,32,.10);
}

.deadline-pill.done,
.job-deadline-line.done {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.profile-score-grid {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}

@media (max-width: 1200px) {
  .profile-score-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 650px) {
  .profile-score-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* v6.6 ultra-modern grouped sidebar + compact responsive UI */
.sidebar-nav.modern-nav {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.nav-group {
  border: 1px solid #eef2f7;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 26px rgba(10,10,11,.04);
  overflow: hidden;
}

.nav-group-toggle {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, #fff, #f9fafb);
  color: #111827;
  min-height: 44px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 1000;
  text-align: left;
  transition: background .18s ease, color .18s ease;
}

.nav-group-toggle:hover,
.nav-group-toggle[aria-expanded="true"] {
  background: #111827;
  color: #fff;
}

.nav-chevron {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  transition: transform .2s ease, background .2s ease;
  background: rgba(17,24,39,.08);
}

.nav-group-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
  background: rgba(255,255,255,.16);
}

.nav-group-panel {
  display: grid;
  gap: 6px;
  padding: 8px;
  animation: navPanelIn .18s ease;
}

.nav-group-panel[hidden] {
  display: none !important;
}

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

.modern-nav .nav-btn {
  min-height: 38px;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  box-shadow: none;
  background: transparent;
}

.modern-nav .nav-btn:hover {
  background: #fff1f2;
  color: #b91c1c;
}

.modern-nav .nav-btn.active {
  background: linear-gradient(135deg, #111827, #1f2937) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(10,10,11,.12);
}

.mobile-nav-toggle {
  display: none;
  border: 0;
  border-radius: 999px;
  background: #d71920;
  color: #fff;
  font-weight: 950;
  padding: 10px 16px;
  box-shadow: 0 12px 28px rgba(215,25,32,.24);
}

/* Make pages less huge and easier to scan */
.card,
.zero-panel,
.inner-card {
  border-radius: 22px;
}

.section-title h2,
.card h2,
.zero-panel h2 {
  font-size: clamp(20px, 1.6vw, 28px);
}

.jk-page {
  --jk-page-gap: 18px;
}

.jk-section-grid,
.raw-full-layout,
.po-layout {
  gap: 18px;
}

.form {
  gap: 12px;
}

input,
select,
textarea {
  min-height: 46px;
  border-radius: 14px;
}

.btn {
  min-height: 42px;
  border-radius: 14px;
}

.table-wrap table th {
  padding-top: 12px;
  padding-bottom: 12px;
}

.table-wrap table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.compact-score-card,
#scorecard .score-card,
#scorecard .employee-score-card,
#scorecard article {
  border-radius: 22px;
  padding: 16px !important;
}

#scorecard .score-card h3,
#scorecard .employee-score-card h3,
#scorecard article h3 {
  margin-bottom: 4px;
}

#scorecard .score-metrics,
#scorecard .score-grid,
#scorecard .metric-grid {
  gap: 10px !important;
}

#scorecard .score-metrics > *,
#scorecard .score-grid > *,
#scorecard .metric-grid > * {
  padding: 10px 12px !important;
  border-radius: 14px !important;
}

.profile-name-btn {
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.profile-name-btn:hover {
  border-bottom-color: #d71920;
}

/* Smooth dropdown arrows on selects */
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #111827 50%),
    linear-gradient(135deg, #111827 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px !important;
}

select:focus {
  background-image:
    linear-gradient(45deg, #d71920 50%, transparent 50%),
    linear-gradient(135deg, transparent 50%, #d71920 50%);
}

/* Layout organization on smaller screens */
@media (max-width: 980px) {
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 100001;
  }

  .sidebar,
  aside,
  .side-panel {
    transform: translateX(-110%);
    transition: transform .24s ease;
  }

  body.nav-open .sidebar,
  body.nav-open aside,
  body.nav-open .side-panel {
    transform: translateX(0);
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(10,10,11,.28);
    pointer-events: none;
  }

  .sidebar-nav.modern-nav {
    max-height: calc(100vh - 40px);
    overflow: auto;
  }
}

@media (max-width: 720px) {
  .nav-group-toggle {
    min-height: 42px;
  }

  .modern-nav .nav-btn {
    min-height: 36px;
  }

  .card,
  .zero-panel,
  .inner-card {
    padding: 14px !important;
  }

  .profile-score-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}


/* v6.7 compact gap fix + smooth inner accordions */
.sidebar-nav.modern-nav {
  gap: 8px !important;
  padding: 10px !important;
}

.nav-group {
  border-radius: 16px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.nav-group-toggle {
  min-height: 42px !important;
  padding: 9px 12px !important;
}

.nav-group-panel {
  padding: 6px !important;
  gap: 5px !important;
  min-height: 0 !important;
}

.nav-group-panel[hidden] {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.modern-nav .nav-btn {
  display: flex !important;
  align-items: center;
  width: 100%;
  min-height: 34px !important;
  padding: 7px 10px !important;
  font-size: 13.5px !important;
  color: #374151;
  visibility: visible !important;
  opacity: 1 !important;
}

.modern-nav .nav-btn.active {
  color: #fff !important;
}

/* Reduce giant page gaps */
section.content {
  padding-top: 18px !important;
}

.jk-section-grid,
.raw-full-layout,
.po-layout {
  gap: 14px !important;
}

.card,
.zero-panel,
.inner-card {
  padding: 18px !important;
  border-radius: 20px !important;
}

.stats-grid {
  gap: 14px !important;
}

.stat-card,
.metric-card {
  min-height: auto !important;
  padding: 16px !important;
}

/* Inner card accordions */
.accordion-card {
  overflow: hidden !important;
}

.accordion-card > .section-title,
.accordion-card > .stack-title,
.accordion-card > .accordion-head {
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.accordion-body {
  padding-top: 14px;
  animation: accBodyIn .18s ease;
}

.accordion-body[hidden] {
  display: none !important;
}

@keyframes accBodyIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.accordion-toggle {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  flex-shrink: 0;
}

.accordion-toggle:hover,
.accordion-toggle[aria-expanded="true"] {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.acc-chevron {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  transition: transform .18s ease;
  background: rgba(17,24,39,.08);
}

.accordion-toggle[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
  background: rgba(255,255,255,.16);
}

/* Keep dashboard compact */
#dashboard .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

#dashboard .stat-card {
  min-height: 112px !important;
}

@media (max-width: 980px) {
  .sidebar-nav.modern-nav {
    padding: 8px !important;
  }

  .nav-group-toggle {
    min-height: 40px !important;
  }

  .modern-nav .nav-btn {
    min-height: 34px !important;
  }
}

@media (max-width: 620px) {
  .accordion-card > .section-title,
  .accordion-card > .stack-title,
  .accordion-card > .accordion-head {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .accordion-toggle {
    width: 100%;
    justify-content: center;
  }

  .card,
  .zero-panel,
  .inner-card {
    padding: 14px !important;
  }
}


/* v6.8 all subsections compact accordion layout */
section.content {
  padding-top: 14px !important;
}

.jk-page {
  --jk-page-gap: 12px;
}

.jk-section-grid,
.raw-full-layout,
.po-layout {
  gap: 12px !important;
}

.card,
.zero-panel,
.inner-card,
.report-card,
.job-column,
.settings-card {
  padding: 14px !important;
  border-radius: 18px !important;
}

.compact-subsection {
  border-radius: 18px !important;
  transition: box-shadow .18s ease, transform .18s ease;
}

.compact-subsection:hover {
  box-shadow: 0 18px 46px rgba(10,10,11,.08);
}

.accordion-card > .section-title,
.accordion-card > .stack-title,
.accordion-card > .job-column-title,
.accordion-card > .accordion-head {
  min-height: 38px;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

.accordion-card > .section-title h2,
.accordion-card > .section-title h3,
.accordion-card > .stack-title h2,
.accordion-card > .stack-title h3,
.accordion-card > .job-column-title h2,
.accordion-card > .job-column-title h3,
.accordion-card > .accordion-head h2,
.accordion-card > .accordion-head h3 {
  margin: 0 !important;
  font-size: clamp(18px, 1.35vw, 24px) !important;
  line-height: 1.15;
}

.accordion-body {
  padding-top: 12px !important;
}

.accordion-body[hidden] {
  display: none !important;
}

.accordion-toggle {
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: 13px;
}

.acc-label {
  min-width: 48px;
  text-align: center;
}

.page-accordion-tools {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.page-accordion-tools .btn {
  min-height: 34px !important;
  padding: 7px 11px !important;
  font-size: 13px;
}

.form {
  gap: 10px !important;
}

.form label {
  gap: 6px !important;
}

input,
select,
textarea {
  min-height: 42px !important;
  border-radius: 13px !important;
}

textarea {
  min-height: 92px;
}

.btn {
  min-height: 38px !important;
  padding: 9px 14px !important;
}

.table-wrap table th,
.table-wrap table td {
  padding: 10px 12px !important;
}

.stats-grid,
.zero-stats,
.jobs-stats,
.score-metrics,
.job-columns,
.closing-grid {
  gap: 10px !important;
}

/* Sidebar still compact */
.sidebar-nav.modern-nav {
  gap: 7px !important;
}

.nav-group {
  border-radius: 14px !important;
}

.nav-group-toggle {
  min-height: 38px !important;
}

.modern-nav .nav-btn {
  min-height: 32px !important;
}

/* Keep accordion tools usable on mobile */
@media (max-width: 700px) {
  .page-accordion-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-accordion-tools .btn {
    width: 100%;
  }

  .accordion-card > .section-title,
  .accordion-card > .stack-title,
  .accordion-card > .job-column-title,
  .accordion-card > .accordion-head {
    gap: 8px;
  }

  .accordion-toggle {
    justify-content: center;
  }

  .card,
  .zero-panel,
  .inner-card,
  .report-card,
  .job-column,
  .settings-card {
    padding: 12px !important;
  }
}


/* v6.9 gap cleanup + closed arrow-only accordions */
section.content {
  padding-top: 10px !important;
}

.jk-page {
  --jk-page-gap: 8px;
}

.jk-section-grid,
.raw-full-layout,
.po-layout {
  gap: 10px !important;
}

.card,
.zero-panel,
.inner-card,
.report-card,
.job-column,
.settings-card {
  padding: 12px !important;
  border-radius: 16px !important;
}

.accordion-card > .section-title,
.accordion-card > .stack-title,
.accordion-card > .job-column-title,
.accordion-card > .accordion-head {
  min-height: 32px !important;
  gap: 8px !important;
}

.accordion-card > .section-title h2,
.accordion-card > .section-title h3,
.accordion-card > .stack-title h2,
.accordion-card > .stack-title h3,
.accordion-card > .job-column-title h2,
.accordion-card > .job-column-title h3,
.accordion-card > .accordion-head h2,
.accordion-card > .accordion-head h3 {
  font-size: clamp(17px, 1.2vw, 22px) !important;
}

.accordion-body {
  padding-top: 10px !important;
}

.accordion-toggle {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-grid !important;
  place-items: center !important;
  font-size: 0 !important;
}

.accordion-toggle .acc-chevron {
  width: 24px;
  height: 24px;
  font-size: 15px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}

.accordion-toggle[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
}

.acc-label,
.page-accordion-tools {
  display: none !important;
}

.stats-grid {
  gap: 10px !important;
}

.stat-card,
.metric-card,
.stats-grid > * {
  min-height: 92px !important;
}

#dashboard .stats-grid > .accordion-card,
#dashboard .stats-grid > .compact-subsection {
  display: none !important;
}

#dashboard .stats-grid .section-title h2,
#dashboard .stats-grid .accordion-head h3 {
  font-size: 0 !important;
}

/* Sidebar compact: no blank white panels */
.sidebar-nav.modern-nav {
  gap: 6px !important;
  padding: 8px !important;
}

.nav-group {
  min-height: 0 !important;
  border-radius: 13px !important;
}

.nav-group-toggle {
  min-height: 36px !important;
  padding: 8px 10px !important;
}

.nav-group-panel {
  min-height: 0 !important;
  padding: 5px !important;
  gap: 4px !important;
}

.nav-group-panel[hidden] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

.modern-nav .nav-btn {
  min-height: 30px !important;
  padding: 6px 9px !important;
}

/* Compact form/table polish */
.form {
  gap: 8px !important;
}

input,
select,
textarea {
  min-height: 40px !important;
}

.btn {
  min-height: 36px !important;
  padding: 8px 12px !important;
}

.table-wrap table th,
.table-wrap table td {
  padding: 9px 10px !important;
}

@media (max-width: 700px) {
  .card,
  .zero-panel,
  .inner-card,
  .report-card,
  .job-column,
  .settings-card {
    padding: 10px !important;
  }
}


/* v7.0 final compact sidebar + dashboard shortcut cards */
.sidebar-nav.modern-nav,
.sidebar-nav.modern-nav.compact-nav-final {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  align-content: stretch !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  padding: 8px !important;
  height: auto !important;
  min-height: 0 !important;
}

.nav-group,
.nav-group.nav-group-compact {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 14px !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
  box-shadow: 0 8px 18px rgba(10,10,11,.045) !important;
}

.nav-group-toggle {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.nav-group-panel,
.nav-panel-compact {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 4px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 360px !important;
  padding: 5px !important;
  margin: 0 !important;
  overflow: auto !important;
}

.nav-group-panel[hidden],
.nav-panel-compact[hidden] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.nav-group:not(.is-open) {
  background: #fff !important;
}

.nav-group:not(.is-open) .nav-group-toggle {
  border-radius: 14px !important;
}

.modern-nav .nav-btn {
  height: 31px !important;
  min-height: 31px !important;
  max-height: 31px !important;
  padding: 5px 10px !important;
  margin: 0 !important;
}

/* Fill/compact dashboard area */
#dashboard .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 10px !important;
  margin-top: 10px !important;
}

#dashboard .stat-card,
#dashboard .metric-card,
#dashboard .stats-grid > * {
  min-height: 86px !important;
  padding: 14px !important;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-shortcut:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(10,10,11,.10) !important;
  border-color: rgba(215,25,32,.24) !important;
}

.dashboard-shortcut:focus {
  outline: 4px solid rgba(215,25,32,.16);
  outline-offset: 2px;
}

#dashboard .stat-card h3,
#dashboard .metric-card h3,
#dashboard .stats-grid h3 {
  font-size: 15px !important;
  margin-bottom: 8px !important;
}

#dashboard .stat-card strong,
#dashboard .metric-card strong,
#dashboard .stats-grid strong {
  font-size: 28px !important;
}

#dashboard .card,
#dashboard .zero-panel,
#dashboard .inner-card {
  margin-top: 10px !important;
}

/* More compact global page spacing */
section.content {
  padding: 10px 18px 18px !important;
}

.jk-page {
  gap: 10px !important;
}

.card,
.zero-panel,
.inner-card,
.report-card,
.job-column,
.settings-card {
  margin-bottom: 10px !important;
}

/* Clickable stat hint */
.dashboard-shortcut::after {
  content: "Open";
  position: absolute;
  right: 14px;
  bottom: 12px;
  opacity: 0;
  color: #d71920;
  font-size: 12px;
  font-weight: 950;
  transition: opacity .16s ease;
}

.dashboard-shortcut {
  position: relative;
}

.dashboard-shortcut:hover::after {
  opacity: 1;
}

@media (max-width: 760px) {
  section.content {
    padding: 8px 10px 14px !important;
  }

  #dashboard .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  #dashboard .stat-card,
  #dashboard .metric-card,
  #dashboard .stats-grid > * {
    min-height: 78px !important;
    padding: 12px !important;
  }

  .sidebar-nav.modern-nav,
  .sidebar-nav.modern-nav.compact-nav-final {
    gap: 6px !important;
  }
}

@media (max-width: 480px) {
  #dashboard .stats-grid {
    grid-template-columns: 1fr !important;
  }
}


/* v7.1 clickable profiles + dashboard click fix */
.dashboard-shortcut {
  cursor: pointer !important;
  position: relative;
  user-select: none;
}

.dashboard-shortcut:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(10,10,11,.12) !important;
}

.entity-link,
.profile-name-btn.inline,
.profile-name-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #111827;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}

.entity-link:hover,
.profile-name-btn:hover {
  color: #d71920;
  border-bottom-color: #d71920;
  transform: translateX(2px);
}

.entity-link.product::before {
  content: "P";
}

.entity-link.raw::before {
  content: "R";
}

.entity-link.supplier::before {
  content: "S";
}

.entity-link.employee::before {
  content: "E";
}

.entity-link::before {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  vertical-align: middle;
}

.entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
}

.entity-profile .profile-score-badge strong {
  font-size: 24px;
}

.profile-work-section p {
  margin: 6px 0;
  color: #374151;
  font-weight: 800;
}

/* Make clickable cells feel intentional */
tbody td:has(.entity-link),
tbody td:has(.profile-name-btn) {
  background: linear-gradient(90deg, rgba(215,25,32,.035), transparent);
}

@media (max-width: 700px) {
  .entity-link::before {
    display: none;
  }
}


/* v7.2 dashboard/edit/value/full-width repairs */
.full-width-master-page,
#products,
#rawmaterials {
  width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
}

#products .jk-section-grid,
#rawmaterials .raw-full-layout,
#rawmaterials .jk-section-grid {
  grid-template-columns: minmax(340px, .78fr) minmax(620px, 1.22fr) !important;
  width: 100% !important;
  max-width: 1680px !important;
  margin: 0 auto !important;
}

#products .card,
#rawmaterials .card {
  max-width: none !important;
}

#products .table-wrap table,
#rawmaterials .table-wrap table {
  min-width: 980px !important;
}

.table-product-img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 11px;
  font-weight: 900;
  color: #6b7280;
}

.dashboard-shortcut {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.dashboard-shortcut * {
  pointer-events: none;
}

.row-actions,
.row-actions *,
.form-actions,
.form-actions * {
  pointer-events: auto !important;
}

#dashboard .dashboard-shortcut {
  border: 1px solid rgba(215,25,32,.08) !important;
}

#dashboard .dashboard-shortcut:hover {
  background: linear-gradient(135deg, #fff, #fff7f7) !important;
}

@media (max-width: 1200px) {
  #products .jk-section-grid,
  #rawmaterials .raw-full-layout,
  #rawmaterials .jk-section-grid {
    grid-template-columns: 1fr !important;
  }
}


/* v7.3 product/raw table and click repair */
#products.v73-fixed-page,
#rawmaterials.v73-fixed-page {
  width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
}

#products .jk-section-grid,
#rawmaterials .raw-full-layout,
#rawmaterials .jk-section-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
  max-width: 1720px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#products .card,
#rawmaterials .card,
#products .raw-list-full-card,
#rawmaterials .raw-list-full-card {
  width: 100% !important;
  max-width: none !important;
}

#products .table-wrap,
#rawmaterials .table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
}

#products table,
#rawmaterials table {
  min-width: 1040px !important;
}

.table-product-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  font-size: 10px;
  font-weight: 950;
}

.dashboard-shortcut,
.v73-dashboard-shortcut {
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none;
}

.dashboard-shortcut *,
.v73-dashboard-shortcut * {
  pointer-events: none !important;
}

.row-actions,
.row-actions *,
.form-actions,
.form-actions *,
.accordion-toggle,
.accordion-toggle *,
.nav-btn,
.nav-group-toggle {
  pointer-events: auto !important;
}

.entity-link {
  pointer-events: auto !important;
}

#dashboard .cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 12px !important;
}

#dashboard .card.stat {
  min-height: 92px !important;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

#dashboard .card.stat:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #fff, #fff7f7) !important;
  box-shadow: 0 18px 36px rgba(10,10,11,.10) !important;
}

@media (max-width: 760px) {
  #dashboard .cards {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 480px) {
  #dashboard .cards {
    grid-template-columns: 1fr !important;
  }
}


/* v7.5 dashboard/daily closing clickable shortcuts */
.v75-shortcut,
.dashboard-shortcut,
.daily-closing-shortcut {
  cursor: pointer !important;
  user-select: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.v75-shortcut:hover,
.dashboard-shortcut:hover,
.daily-closing-shortcut:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ffffff, #fff7f7) !important;
  border-color: rgba(215,25,32,.28) !important;
  box-shadow: 0 18px 36px rgba(10,10,11,.10) !important;
}

.v75-shortcut:focus,
.dashboard-shortcut:focus,
.daily-closing-shortcut:focus {
  outline: 4px solid rgba(215,25,32,.16);
  outline-offset: 2px;
}

.v75-shortcut::after,
.daily-closing-shortcut::after {
  content: "Open";
  position: absolute;
  right: 14px;
  bottom: 10px;
  opacity: 0;
  color: #d71920;
  font-size: 11px;
  font-weight: 1000;
  transition: opacity .16s ease;
}

.v75-shortcut:hover::after,
.daily-closing-shortcut:hover::after {
  opacity: 1;
}

.v75-shortcut,
.daily-closing-shortcut {
  position: relative;
}

.v75-metric-active {
  border-color: rgba(215,25,32,.48) !important;
  box-shadow: 0 0 0 4px rgba(215,25,32,.10), 0 18px 36px rgba(10,10,11,.10) !important;
}


/* v7.6 stronger clickable shortcuts + employee profile links */
.v76-force-shortcut,
.dashboard-shortcut,
.daily-closing-shortcut {
  cursor: pointer !important;
  user-select: none;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.v76-force-shortcut:hover,
.dashboard-shortcut:hover,
.daily-closing-shortcut:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #fff, #fff7f7) !important;
  border-color: rgba(215,25,32,.34) !important;
  box-shadow: 0 18px 38px rgba(10,10,11,.12) !important;
}

.v76-force-shortcut:focus,
.dashboard-shortcut:focus,
.daily-closing-shortcut:focus {
  outline: 4px solid rgba(215,25,32,.16);
  outline-offset: 2px;
}

.v76-closing-active {
  border-color: rgba(215,25,32,.55) !important;
  box-shadow: 0 0 0 4px rgba(215,25,32,.12), 0 18px 38px rgba(10,10,11,.12) !important;
}

.v76-employee-link,
.profile-name-btn.v76-employee-link {
  color: #111827;
  font-weight: 950;
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}

.v76-employee-link:hover,
.profile-name-btn.v76-employee-link:hover {
  color: #d71920;
  border-bottom-color: #d71920;
  transform: translateX(2px);
}

/* keep Daily Closing cards clean and responsive */
#closing .zero-stats,
#closing .stats-grid {
  gap: 12px !important;
}

#closing .zero-stat,
#dashboard .card.stat {
  min-height: 92px;
  touch-action: manipulation;
}

@media (max-width: 900px) {
  #closing .zero-stats,
  #dashboard .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 520px) {
  #closing .zero-stats,
  #dashboard .cards {
    grid-template-columns: 1fr !important;
  }
}


/* v7.7 hard click / edit / accordion fix */
.jk-hard-shortcut,
.dashboard-shortcut,
.daily-closing-shortcut {
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.jk-hard-shortcut:hover,
.dashboard-shortcut:hover,
.daily-closing-shortcut:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg,#fff,#fff7f7) !important;
  border-color: rgba(215,25,32,.34) !important;
  box-shadow: 0 18px 38px rgba(10,10,11,.12) !important;
}
.jk-hard-shortcut:focus,
.dashboard-shortcut:focus,
.daily-closing-shortcut:focus {
  outline: 4px solid rgba(215,25,32,.16);
  outline-offset: 2px;
}
.jk-metric-active {
  border-color: rgba(215,25,32,.55) !important;
  box-shadow: 0 0 0 4px rgba(215,25,32,.12), 0 18px 38px rgba(10,10,11,.12) !important;
}
.row-actions button,
button[data-action-button] {
  pointer-events: auto !important;
  position: relative;
  z-index: 5;
}
.jk-hard-employee,
.profile-name-btn.inline.jk-hard-employee {
  color: #111827;
  font-weight: 950;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.jk-hard-employee:hover {
  color: #d71920;
  border-bottom-color: #d71920;
}
#products .accordion-body:not([hidden]),
#closing .accordion-body:not([hidden]),
#rawmaterials .accordion-body:not([hidden]) {
  animation: accBodyIn .18s ease;
}


/* v7.8 location columns + daily closing shortcut */
#dashboard .card.stat[data-hard-tab="closing"],
#dashboard .card.stat[data-dashboard-target="closing"] {
  border-color: rgba(215,25,32,.18) !important;
}

#products table,
#rawmaterials table {
  min-width: 1120px !important;
}

#products th:nth-child(4),
#products td:nth-child(4),
#rawmaterials th:nth-child(4),
#rawmaterials td:nth-child(4) {
  min-width: 130px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

button[data-report="dailywork"] {
  background: linear-gradient(135deg, #111827, #d71920) !important;
  box-shadow: 0 14px 28px rgba(215,25,32,.22);
}


/* v7.9 journey duplicate and dropdown fix */
.jk-dropdown-host {
  position: relative !important;
  z-index: 100;
}

.jk-inline-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  z-index: 100000;
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(10,10,11,.30);
  padding: 6px;
}

.jk-smart-option {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  transition: background-color .16s ease, transform .16s ease;
}

.jk-smart-option:hover,
.jk-smart-option.active {
  background: #d71920;
  transform: translateX(2px);
}

.jk-smart-option.create {
  background: #d71920;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}

.jk-smart-option small,
.jk-smart-empty {
  color: rgba(255,255,255,.78);
  font-weight: 750;
}

.jk-smart-empty {
  padding: 12px;
}

input.jk-dropdown-active {
  outline: 4px solid rgba(215,25,32,.14);
  border-color: #d71920;
}


/* v8.0 move top action buttons to Settings & Sync */
.app-header-clean {
  display: flex;
  justify-content: flex-start !important;
  align-items: center;
}

.app-header-clean .header-actions {
  display: none !important;
}

.settings-action-card {
  grid-column: 1 / -1;
}

.settings-action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.settings-action-buttons .btn,
.settings-action-buttons .file-label,
.settings-action-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  min-height: 46px;
  border-radius: 15px;
}

.settings-action-buttons .file-label {
  display: inline-flex;
  align-items: center;
}

.settings-action-note {
  margin-top: 12px;
  color: #6b7280;
  font-weight: 800;
}

#settingsActionCenter .accordion-body {
  padding-top: 14px;
}

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


/* v8.1 operations intelligence suite */
.page-workorders,
.page-stockaudit,
.page-intelligence,
.page-searchdocs,
.page-automation,
.page-backupcenter {
  width: 100%;
  max-width: none;
}

.work-order-form,
.adjustment-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.work-order-form label:nth-last-child(2),
.adjustment-form label:nth-last-child(2) {
  grid-column: 1 / -1;
}

.search.wide {
  width: 100%;
  max-width: 100%;
  margin-bottom: 14px;
}

.search-result-card,
.v81-click-card {
  cursor: pointer;
}

.document-gallery .score-card {
  overflow: hidden;
}

.wa-preview {
  white-space: pre-wrap;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  color: #111827;
}

.danger-text {
  color: #be123c;
  font-weight: 900;
}

#workOrdersTable td,
#adjustmentsTable td {
  vertical-align: top;
}

@media (max-width: 1100px) {
  .work-order-form,
  .adjustment-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .work-order-form,
  .adjustment-form {
    grid-template-columns: 1fr;
  }
}


/* v8.2 dynamic user UI visibility */
.permission-hidden,
[hidden].permission-hidden {
  display: none !important;
}

.feature-visibility-box {
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #ffffff, #fff7f7);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.feature-check-line {
  border: 1px solid #eef2f7;
  background: #fff;
  border-radius: 13px;
  padding: 9px 10px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.feature-check-line:hover {
  transform: translateY(-1px);
  border-color: rgba(215,25,32,.28);
  background: #fffafa;
}

.mini-note {
  margin: 6px 0 0;
  color: #6b7280;
  font-weight: 800;
  font-size: 13px;
}

.compact-actions {
  margin-top: 10px;
  gap: 8px;
}

.tab {
  transition: opacity .18s ease, transform .18s ease;
}

.nav-btn,
.nav-group,
.card,
.dashboard-shortcut {
  transition: opacity .18s ease, transform .18s ease, max-height .18s ease, margin .18s ease, padding .18s ease;
}

#permissionLabel {
  white-space: normal;
}

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

  .compact-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* v8.3 today-default filters and full-width alignment */
#journey .unified-journey-grid,
#journey .journey-grid,
#journey .jk83-full-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
  max-width: 1720px !important;
  margin: 0 auto !important;
  gap: 14px !important;
}

#journey .journey-list-card,
#journey .journey-form-card {
  width: 100% !important;
  max-width: none !important;
}

#journey .journey-list-card {
  order: 1;
}

#journey .journey-form-card {
  order: 2;
}

#products .jk-section-grid,
#rawmaterials .raw-full-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  max-width: 1720px !important;
  gap: 14px !important;
}

#rawmaterials .raw-list-full-card,
#products .card {
  width: 100% !important;
  max-width: none !important;
}

#journey .journey-table-wrap table,
#jobs .job-list,
#products table,
#rawmaterials table {
  width: 100%;
}

#journey .journey-table-wrap table {
  min-width: 1080px;
}

.journey-filters,
.unified-journey-filters,
.job-filters,
.score-filters,
.batch-filters,
.supplier-history-filters {
  display: grid !important;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(130px, 1fr));
  gap: 12px !important;
  align-items: end !important;
  width: 100%;
}

.score-filters {
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr);
}

.batch-filters,
.supplier-history-filters {
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(140px, 1fr));
}

.journey-filters label,
.job-filters label,
.score-filters label,
.batch-filters label,
.supplier-history-filters label {
  display: grid !important;
  gap: 6px;
  min-width: 0;
  font-weight: 850;
}

.journey-filters input,
.journey-filters select,
.job-filters input,
.job-filters select,
.score-filters input,
.score-filters select,
.batch-filters input,
.batch-filters select,
.supplier-history-filters input,
.supplier-history-filters select {
  width: 100% !important;
  min-width: 0 !important;
}

.section-title,
.stack-title {
  gap: 12px !important;
  align-items: center !important;
}

.section-title > input.search,
.stack-title > input.search,
.section-title .search,
.stack-title .search {
  margin-left: auto;
  width: min(420px, 100%);
}

.section-title .btn,
.stack-title .btn {
  white-space: nowrap;
}

.today-default-note {
  margin: 10px 0 12px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff7f7;
  color: #9f0712;
  border: 1px solid #fecdd3;
  font-size: 12px;
  font-weight: 900;
  width: fit-content;
}

.mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

@media (max-width: 1180px) {
  .journey-filters,
  .unified-journey-filters,
  .job-filters,
  .score-filters,
  .batch-filters,
  .supplier-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .journey-filters label:first-child,
  .job-filters label:first-child,
  .score-filters label:first-child,
  .batch-filters label:first-child,
  .supplier-history-filters label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .journey-filters,
  .unified-journey-filters,
  .job-filters,
  .score-filters,
  .batch-filters,
  .supplier-history-filters {
    grid-template-columns: 1fr !important;
  }

  .section-title,
  .stack-title {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
  }

  .section-title > input.search,
  .stack-title > input.search,
  .section-title .search,
  .stack-title .search,
  .section-title .btn,
  .stack-title .btn {
    grid-column: 1 / -1;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .today-default-note {
    width: 100%;
    border-radius: 14px;
  }
}


/* v8.4 Assign Tasks */
.assign-task-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
}

.assign-task-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.assign-task-form label:nth-last-child(2) {
  grid-column: 1 / -1;
}

.assign-task-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
}

.assign-task-filters label {
  display: grid;
  gap: 6px;
  font-weight: 850;
  min-width: 0;
}

.assign-task-filters input,
.assign-task-filters select {
  width: 100%;
  min-width: 0;
}

.assign-task-table {
  min-width: 1120px;
}

.assign-task-shortcut {
  border-color: rgba(215,25,32,.18) !important;
}

.assign-task-shortcut:hover {
  background: linear-gradient(135deg, #fff, #fff7f7) !important;
  border-color: rgba(215,25,32,.34) !important;
}

@media (max-width: 1100px) {
  .assign-task-form,
  .assign-task-filters {
    grid-template-columns: 1fr 1fr;
  }

  .assign-task-filters label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .assign-task-form,
  .assign-task-filters {
    grid-template-columns: 1fr;
  }
}


/* v8.5 Individual Employee Task Dashboard */
.employee-task-dashboard-card {
  width: 100%;
  max-width: 1720px;
  margin: 14px auto;
  overflow: visible !important;
}

.employee-task-dashboard-card .section-title {
  align-items: center;
}

.employee-task-board-select {
  width: min(280px, 100%);
  margin-left: auto;
}

.employee-task-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.employee-task-stats article {
  border: 1px solid #eef2f7;
  border-radius: 16px;
  background: #f9fafb;
  padding: 12px;
}

.employee-task-stats span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.employee-task-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  color: #111827;
}

.employee-task-board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.task-board-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.task-board-subhead h3 {
  margin: 0;
  font-size: 18px;
}

.employee-task-card-list {
  display: grid;
  gap: 10px;
}

.employee-task-card,
.employee-taken-card {
  border: 1px solid #eef2f7;
  border-left: 5px solid #d71920;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(10,10,11,.045);
}

.employee-task-card.complete {
  border-left-color: #059669;
}

.task-pill-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-metrics {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 10px;
}

.task-note-line,
.task-wastage-line {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-weight: 850;
}

.task-wastage-line {
  color: #be123c;
}

.task-progress-actions {
  margin-top: 10px;
}

.empty-soft {
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  padding: 14px;
  color: #6b7280;
  background: #f9fafb;
  font-weight: 850;
}

@media (max-width: 1050px) {
  .employee-task-board-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .employee-task-dashboard-card .section-title {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .employee-task-board-select {
    width: 100%;
    margin-left: 0;
  }

  .task-board-subhead {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-board-subhead .btn {
    width: 100%;
  }

  .task-progress-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-progress-actions .btn {
    width: 100%;
  }
}


/* v8.6 employee dashboard cleanup, carried-over jobs and scorecard */
#dashboardEmployeeTaskCard {
  display: none !important;
}

.today-default-note {
  display: none !important;
}

#scorecard .section-title h2::after {
  content: "";
}

#scorecardList .score-card {
  border-radius: 20px;
}

#scorecardList .score-metrics {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.permission-hidden {
  display: none !important;
}

.task-wastage-line {
  display: block;
  color: #be123c;
  font-weight: 900;
  margin-top: 4px;
}

@media (max-width: 720px) {
  #scorecardList .score-metrics {
    grid-template-columns: 1fr 1fr;
  }
}


/* v8.7 JustKalinga Operations SOW Integration */
.page-opsdashboard,
.page-workflowtasks,
.page-logistics,
.page-staffusers,
.page-systemhealth {
  width: 100%;
  max-width: none;
}

.sow-director-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}

.sow-profile-card {
  background: #f7faf8;
  border-right: 1px solid #e5e7eb;
  padding: 22px;
}

.sow-avatar {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #114d3f;
  color: #fff;
  font-weight: 1000;
  font-size: 22px;
  margin-bottom: 12px;
}

.sow-profile-card h3 {
  margin: 0 0 4px;
}

.sow-profile-card p {
  margin: 0 0 18px;
  color: #6b7280;
  font-weight: 800;
}

.sow-side-link {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-weight: 900;
}

.sow-side-link.active {
  color: #114d3f;
  border-left: 4px solid #d0a928;
  padding-left: 12px;
}

.sow-main-panel {
  padding: 22px;
}

.ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.ops-metric-grid article {
  border: 1px solid #e5e7eb;
  border-top: 5px solid #114d3f;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(10,10,11,.05);
}

.ops-metric-grid article:nth-child(odd) {
  border-top-color: #d0a928;
}

.ops-metric-grid span {
  display: block;
  color: #6b7280;
  font-weight: 950;
  font-size: 12px;
  text-transform: uppercase;
}

.ops-metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  color: #114d3f;
}

.ops-alert-card {
  margin-top: 18px;
}

.ops-filter-grid,
.staff-form,
.ops-task-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.ops-filter-grid label,
.staff-form label,
.ops-task-form label {
  display: grid;
  gap: 6px;
  font-weight: 850;
}

.staff-form label:nth-last-child(2),
.ops-task-form label:nth-last-child(2) {
  grid-column: 1 / -1;
}

.sow-webhook-grid,
.logistics-board,
.sow-schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.logistics-board section {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #f9fafb;
  padding: 14px;
  min-height: 180px;
}

.logistics-board h3 {
  margin-top: 0;
  color: #114d3f;
}

.ops-kanban-list {
  display: grid;
  gap: 10px;
}

.ops-task-card {
  border: 1px solid #e5e7eb;
  border-left: 5px solid #114d3f;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.ops-task-card p {
  margin: 6px 0;
  color: #374151;
  font-weight: 850;
}

.whatsapp-green {
  background: #20c767 !important;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(32,199,103,.20) !important;
}

.technical-note {
  margin-top: 14px;
  border-left: 5px solid #d0a928;
  background: #fff8e1;
  border-radius: 12px;
  padding: 14px;
  color: #374151;
  font-weight: 850;
}

.sow-schema-grid section {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.sow-schema-grid h3 {
  margin-top: 0;
  color: #114d3f;
}

.sow-schema-grid li {
  margin: 6px 0;
  font-weight: 850;
}

.sow-shortcut {
  border-color: rgba(17,77,63,.18) !important;
}

.sow-shortcut:hover {
  background: linear-gradient(135deg, #fff, #f4faf7) !important;
  border-color: rgba(17,77,63,.38) !important;
}

@media (max-width: 1000px) {
  .sow-director-shell {
    grid-template-columns: 1fr;
  }

  .sow-profile-card {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .ops-filter-grid,
  .staff-form,
  .ops-task-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .ops-filter-grid,
  .staff-form,
  .ops-task-form,
  .sow-webhook-grid,
  .logistics-board,
  .sow-schema-grid {
    grid-template-columns: 1fr;
  }

  .sow-main-panel,
  .sow-profile-card {
    padding: 14px;
  }
}


/* v8.8 cleanup: Operation, merged employees/staff, hard actions, JK brand colors */
[data-nav-group="operations"] .nav-group-toggle[aria-expanded="true"],
[data-nav-group="operations"].is-open .nav-group-toggle {
  background: linear-gradient(135deg, #111827, #d71920) !important;
  color: #fff !important;
}

.sow-profile-card {
  background: linear-gradient(180deg, #111827, #1f2937) !important;
  color: #fff !important;
  border-right: 0 !important;
}

.sow-avatar {
  background: #d71920 !important;
  color: #fff !important;
}

.sow-profile-card p,
.sow-side-link {
  color: rgba(255,255,255,.78) !important;
}

.sow-side-link.active {
  color: #fff !important;
  border-left-color: #d71920 !important;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
}

.ops-metric-grid article {
  border-top-color: #111827 !important;
}

.ops-metric-grid article:nth-child(odd) {
  border-top-color: #d71920 !important;
}

.ops-metric-grid strong,
.logistics-board h3,
.sow-schema-grid h3 {
  color: #111827 !important;
}

.technical-note {
  border-left-color: #d71920 !important;
  background: #fff1f2 !important;
}

.ops-task-card {
  border-left-color: #d71920 !important;
}

.sow-shortcut {
  border-color: rgba(215,25,32,.18) !important;
}

.sow-shortcut:hover {
  background: linear-gradient(135deg, #fff, #fff7f7) !important;
  border-color: rgba(215,25,32,.38) !important;
}

.small-profile-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  font-weight: 1000;
}

.muted-lock {
  opacity: .75;
}

#employees table {
  min-width: 1060px;
}

#staffusers {
  display: none !important;
}


/* v8.9 API center + dropdown/action repair */
.page-api-center > .accordion-card,
#systemhealth > .accordion-card,
#workflowtasks > .accordion-card,
#workorders > .accordion-card,
#employees > .jk-section-grid > .accordion-card {
  width: 100%;
  max-width: none;
}

.api-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.api-health-tile {
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border-left: 5px solid #d71920;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.api-health-tile:hover { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(15,23,42,.14); border-color: rgba(215,25,32,.45); }
.api-health-tile span { display:block; color:#6b7280; font-weight:900; text-transform:uppercase; letter-spacing:.04em; font-size:.78rem; }
.api-health-tile strong { display:block; margin-top:8px; font-size:1.6rem; color:#111827; }
.api-health-tile small { display:block; margin-top:5px; color:#6b7280; }

.api-connection-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
.api-connection-form .full-span { grid-column: 1 / -1; }
.api-table-wrap table { min-width: 1120px; }
.api-url-cell { max-width: 340px; word-break: break-all; color:#4b5563; }
.fixed-api-webhooks { align-items: stretch; }
.fixed-api-webhooks .form { min-width: 0; }
.fixed-api-webhooks textarea { min-height: 180px; resize: vertical; }
.api-schema-clean { grid-template-columns: repeat(3, minmax(0, 1fr)); }

#workflowtasks .ops-task-form,
#workorders .work-order-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
#workorders .work-order-form label:nth-child(6),
#workflowtasks .ops-task-form label:last-of-type { grid-column: 1 / -1; }

#employees .jk-section-grid { grid-template-columns: 1fr; }
#employees #employeeForm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#employees #employeeForm .profile-image-preview,
#employees #employeeForm .form-actions { grid-column: 1 / -1; }
#employees .table-wrap table { min-width: 1180px; }

.jk-dropdown-host { position: relative; overflow: visible !important; }
.jk-inline-dropdown {
  position: absolute;
  z-index: 9999;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  max-height: 260px;
  overflow: auto;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  padding: 8px;
  box-shadow: 0 22px 50px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.12);
}
.jk-smart-option {
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background .15s ease, transform .15s ease;
}
.jk-smart-option:hover,
.jk-smart-option.active { background: rgba(255,255,255,.12); transform: translateX(2px); }
.jk-smart-option.create { background: rgba(215,25,32,.24); }
.jk-smart-option span { font-weight: 950; }
.jk-smart-option small { color: rgba(255,255,255,.72); }
.jk-smart-empty { padding: 14px; color: rgba(255,255,255,.8); }
.jk-dropdown-active { border-color: #d71920 !important; box-shadow: 0 0 0 4px rgba(215,25,32,.12) !important; }

@media (max-width: 1100px) {
  .api-health-grid,
  .api-schema-clean,
  .api-connection-form,
  #workflowtasks .ops-task-form,
  #workorders .work-order-form,
  #employees #employeeForm { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .api-health-grid,
  .api-schema-clean,
  .api-connection-form,
  #workflowtasks .ops-task-form,
  #workorders .work-order-form,
  #employees #employeeForm { grid-template-columns: 1fr; }
  .api-connection-form .full-span { grid-column: auto; }
  .fixed-api-webhooks { grid-template-columns: 1fr; }
}


/* v9.0 people/actions + work-order searchable dropdown repair */
#people .jk-section-grid,
#employees .jk-section-grid,
#people .jk90-single-column,
#employees .jk90-single-column {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

#people .table-wrap table,
#employees .table-wrap table {
  min-width: 820px !important;
}

#people .row-actions,
#employees .row-actions,
#products .row-actions,
#rawmaterials .row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#workorders .work-order-form label,
#workflowtasks .ops-task-form label,
#people .form label,
#employees .form label {
  min-width: 0;
  overflow: visible !important;
}

#workorders .work-order-form,
#workflowtasks .ops-task-form {
  overflow: visible !important;
}

#workorders .card,
#workflowtasks .card,
#people .card,
#employees .card {
  overflow: visible !important;
}

.jk-inline-dropdown.jk90-dropdown {
  z-index: 2147483000 !important;
  max-height: 310px !important;
  width: 100% !important;
  min-width: 260px;
}

.jk90-dropdown .jk-smart-option {
  width: 100%;
  text-align: left;
  border: 0;
  color: #fff;
  background: transparent;
  font: inherit;
}

.jk90-dropdown .jk-smart-option.create {
  background: rgba(215,25,32,.28) !important;
}

.profile-image-preview img,
.small-profile-thumb {
  object-fit: cover;
}

@media (max-width: 900px) {
  #workorders .work-order-form,
  #workflowtasks .ops-task-form,
  #employees #employeeForm,
  #people #contactForm {
    grid-template-columns: 1fr !important;
  }
  #people .table-wrap table,
  #employees .table-wrap table {
    min-width: 720px !important;
  }
}


/* v9.1: guaranteed visible work-order dropdown */
.jk91-fixed-dropdown {
  position: fixed !important;
  z-index: 2147483647 !important;
  background: #111827 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.35) !important;
  padding: 8px !important;
  overflow: auto !important;
  pointer-events: auto !important;
}
.jk91-fixed-dropdown .jk-smart-option {
  width: 100% !important;
  text-align: left !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #fff !important;
  padding: 12px 14px !important;
  cursor: pointer !important;
  font: inherit !important;
}
.jk91-fixed-dropdown .jk-smart-option:hover,
.jk91-fixed-dropdown .jk-smart-option.active {
  background: rgba(255,255,255,.14) !important;
}
.jk91-fixed-dropdown .jk-smart-option.create {
  background: rgba(215,25,32,.32) !important;
}
.jk91-fixed-dropdown .jk-smart-option span { font-weight: 950 !important; }
.jk91-fixed-dropdown .jk-smart-option small { color: rgba(255,255,255,.72) !important; }
#workorders .work-order-form input[data-lookup] {
  background-image: linear-gradient(45deg, transparent 50%, #111827 50%), linear-gradient(135deg, #111827 50%, transparent 50%) !important;
  background-position: calc(100% - 22px) center, calc(100% - 16px) center !important;
  background-size: 7px 7px, 7px 7px !important;
  background-repeat: no-repeat !important;
  padding-right: 46px !important;
}


/* v9.2 universal dropdown rebuild */
.jk92-dropdown {
  position: fixed;
  z-index: 2147483000;
  overflow: auto;
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.30);
  padding: 8px;
  animation: jk92Drop .14s ease-out;
}
@keyframes jk92Drop { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.jk92-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  display: grid;
  gap: 3px;
  padding: 12px 13px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  transition: background .16s ease, transform .16s ease;
}
.jk92-option:hover,
.jk92-option.active { background: rgba(255,255,255,.12); transform: translateX(2px); }
.jk92-option.create { background: rgba(215,25,32,.20); }
.jk92-option span { font-weight: 950; }
.jk92-option small { color: rgba(255,255,255,.70); font-weight: 800; }
.jk92-empty { padding: 16px; color: rgba(255,255,255,.75); font-weight: 850; }
input.jk92-active { border-color: #d71920 !important; box-shadow: 0 0 0 4px rgba(215,25,32,.14) !important; }
.jk92-comma-helper { display: block; margin-top: 6px; color: #6b7280; font-weight: 800; line-height: 1.35; }
@media (max-width: 720px) { .jk92-dropdown { left: 10px !important; right: 10px !important; width: auto !important; max-height: 50vh !important; } }

/* v9.3 final dropdown fix: always visible inline dropdowns */
.jk93-host,
label:has(> input[data-lookup]) {
  overflow: visible !important;
}
input.jk93-active {
  border-color: #d71920 !important;
  box-shadow: 0 0 0 4px rgba(215,25,32,.14) !important;
}
.jk93-menu {
  width: 100%;
  max-height: 310px;
  overflow: auto;
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 8px;
  background: #101827;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0,0,0,.26);
  color: #fff;
  z-index: 2147483600;
  position: relative;
  animation: jk93Open .13s ease-out;
}
@keyframes jk93Open {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.jk93-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 12px 13px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease, transform .15s ease;
}
.jk93-option:hover,
.jk93-option.active {
  background: rgba(255,255,255,.13);
  transform: translateX(2px);
}
.jk93-option.create {
  background: rgba(215,25,32,.22);
}
.jk93-option span {
  font-weight: 1000;
}
.jk93-option small {
  color: rgba(255,255,255,.72);
  font-weight: 800;
}
.jk93-empty {
  color: rgba(255,255,255,.78);
  font-weight: 850;
  padding: 14px;
}
@media (max-width: 720px) {
  .jk93-menu { max-height: 45vh; }
}

/* v9.4 complete dropdown rescue - body fixed menu above everything */
input.jk94-active {
  border-color: #d71920 !important;
  box-shadow: 0 0 0 4px rgba(215,25,32,.14) !important;
}
.jk94-menu {
  position: fixed !important;
  z-index: 2147483647 !important;
  display: block !important;
  overflow: auto !important;
  padding: 8px !important;
  background: #101827 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 16px !important;
  box-shadow: 0 22px 52px rgba(0,0,0,.34) !important;
  animation: jk94Open .12s ease-out;
}
@keyframes jk94Open {
  from { opacity: 0; transform: translateY(-4px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.jk94-option {
  display: grid !important;
  gap: 3px !important;
  width: 100% !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #fff !important;
  padding: 12px 13px !important;
  text-align: left !important;
  cursor: pointer !important;
  font: inherit !important;
}
.jk94-option:hover,
.jk94-option.active {
  background: rgba(255,255,255,.14) !important;
}
.jk94-option.create {
  background: rgba(215,25,32,.24) !important;
}
.jk94-option span { font-weight: 1000 !important; }
.jk94-option small { color: rgba(255,255,255,.74) !important; font-weight: 800 !important; }
.jk94-empty { color: rgba(255,255,255,.78) !important; font-weight: 850 !important; padding: 14px !important; }
@media (max-width: 720px) {
  .jk94-menu { left: 10px !important; right: 10px !important; width: auto !important; max-height: 46vh !important; }
}
