/* ========================================================================== 
   Van Lierde — Inventory Management
   Responsive presentation layer (2026-07-31)

   This stylesheet loads after Bootstrap and the compiled application CSS.
   Selectors are deliberately scoped so the existing React behaviour and API
   integrations remain untouched.
   ========================================================================== */

:root {
  --ground: #f3f5f8;
  --surface: #ffffff;
  --ink: #0e1a26;
  --ink-soft: #33465a;
  --muted: #66798c;
  --line: #e1e7ee;
  --line-soft: #edf1f5;

  --brand: #0f766e;
  --brand-hover: #0c5f58;
  --brand-soft: rgba(15, 118, 110, 0.09);
  --brand-ring: rgba(15, 118, 110, 0.22);

  --nav-bg: #0f1a28;
  --nav-bg-2: #0b141f;
  --nav-ink: #b9c6d4;
  --nav-ink-strong: #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(14, 26, 38, 0.05);
  --shadow: 0 1px 3px rgba(14, 26, 38, 0.07),
    0 8px 24px -12px rgba(14, 26, 38, 0.16);
}

/* ---------- basis en overflowbeveiliging ---------- */
html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

#root,
.App,
.content,
.content > main {
  min-width: 0;
  max-width: 100%;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-hover);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- hoofdindeling ---------- */
.App {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
  background: var(--ground);
}

/* Reset de oude fixed-sidebar compensatie uit App.css. */
.content {
  flex: 1 1 0%;
  width: auto;
  min-width: 0;
  margin-left: 0 !important;
  padding: 0 !important;
  background:
    radial-gradient(
      1200px 400px at 100% -5%,
      rgba(15, 118, 110, 0.045),
      transparent 60%
    ),
    var(--ground);
}

.content > main.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto !important;
  padding: 40px clamp(32px, 3vw, 48px) 56px;
}

/* Dashboard heeft zelf nog een Bootstrap-container. */
.content > main.container > .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.content > main.container > .container > .row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
  align-items: start;
  gap: 24px;
  margin: 0;
}

.content > main.container > .container > .row > .col-md-8,
.content > main.container > .container > .row > .col-md-4 {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 0;
}

/* Houd formulieren leesbaar; rapporttabellen behouden de volle kaartbreedte. */
.content > main.container > .container > .row > .col-md-8 .section > form {
  max-width: 760px;
}

/* ---------- zijbalk ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 20;
  width: 258px;
  height: 100vh;
  flex: 0 0 258px;
  margin: 0;
  padding: 0 14px 28px;
  overflow-y: auto;
  color: var(--nav-ink-strong);
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 14px;
  padding: 24px 8px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header::before {
  content: "VL";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: #ffffff;
  background: linear-gradient(150deg, #14b8a6 0%, var(--brand) 70%);
  border-radius: 10px;
  box-shadow: 0 4px 12px -4px rgba(20, 184, 166, 0.55);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-header h3 {
  min-width: 0;
  margin: 0;
  color: var(--nav-ink-strong);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sidebar .nav {
  width: 100%;
}

.sidebar .nav::before {
  content: "Beheer";
  display: block;
  padding: 0 10px 8px;
  color: rgba(185, 198, 212, 0.55);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sidebar .nav-item {
  min-width: 0;
  margin: 0 0 2px;
  padding: 0;
  border: 0;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 11px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  color: var(--nav-ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.sidebar .nav-link .nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-right: 0;
  opacity: 0.75;
}

.sidebar .nav-link:hover {
  color: var(--nav-ink-strong);
  background: rgba(255, 255, 255, 0.07);
}

.sidebar .nav-link.active {
  color: #ffffff;
  background: rgba(20, 184, 166, 0.16);
  border: 0;
  box-shadow: inset 3px 0 0 #2dd4bf;
  font-weight: 600;
}

.sidebar .nav-link.active .nav-icon {
  color: #5eead4;
  opacity: 1;
}

.mobile-menu-toggle {
  display: none;
}

/* ---------- kaarten en titels ---------- */
.section {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 0 22px;
  padding: 26px 26px 28px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section > h1,
.section > h2,
.section > h3,
.location-details > h1,
.location-details > h2 {
  margin: 0 0 20px;
  padding: 0 0 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.section > h2 + form,
.section > h2 + .list-group {
  margin-top: 2px;
}

/* ---------- formulieren ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group label,
.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-control,
select.form-control,
input.form-control,
textarea.form-control {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--ink);
  background-color: #fcfdfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.form-control::placeholder {
  color: #9aa9b8;
}

.form-control:hover {
  border-color: #cfd8e3;
}

.form-control:focus {
  outline: none;
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

select.form-control {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2366798C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.section > .form-control.mb-3 {
  max-width: 680px;
  margin-bottom: 18px !important;
}

/* ---------- knoppen ---------- */
.btn,
.btn.btn-primary,
.btn.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.005em;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary,
.btn.btn-primary {
  color: #ffffff;
  background-color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover,
.btn.btn-primary:hover {
  color: #ffffff;
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-secondary,
.btn.btn-secondary {
  color: var(--ink-soft);
  background-color: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
  color: var(--ink);
  background-color: #f7f9fb;
  border-color: #cfd8e3;
}

.btn-danger {
  color: #ffffff;
  background-color: #b42318;
  border-color: #b42318;
}

.btn-danger:hover {
  color: #ffffff;
  background-color: #912018;
  border-color: #912018;
}

.section form .btn {
  width: 100%;
}

.section form .btn + .btn {
  margin-top: 10px;
  margin-left: 0 !important;
}

.section > .btn.mb-3 {
  margin-bottom: 16px !important;
}

/* ---------- lijsten ---------- */
.section > ul,
.list-group {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.section > ul > li,
.list-group-item {
  min-width: 0;
  margin: 0;
  padding: 13px 16px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.13s ease;
}

.section > ul > li:last-child,
.list-group-item:last-child {
  border-bottom: 0;
}

.section > ul > li:hover,
.list-group-item:hover {
  background: #f8fafc;
}

.section li strong,
.section li b,
.list-group-item strong,
.list-group-item b {
  color: var(--ink);
  font-weight: 650;
}

.list-group-item a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.list-group-item a:hover {
  text-decoration: underline;
}

/* ---------- tabellen en rapportresultaten ---------- */
.report-results {
  width: 100%;
  min-width: 0;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.report-results > h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.table-responsive .table {
  min-width: 640px;
}

.table thead th {
  padding: 11px 14px;
  color: var(--muted);
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.table tbody td {
  padding: 12px 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #f8fafc;
}

/* ---------- locaties en QR-codes ---------- */
.section img {
  max-width: 100%;
  height: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.location-list .location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.location-description {
  min-width: 0;
  margin-right: 0;
  cursor: pointer;
}

.section .qr-code-small {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  cursor: pointer;
}

.qr-modal {
  z-index: 1100;
  padding: 16px;
}

.qr-modal-content {
  max-width: min(92vw, 440px);
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(14, 26, 38, 0.28);
}

.close-button {
  display: grid;
  place-items: center;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  line-height: 1;
}

.section .qr-code-large {
  display: block;
  width: auto;
  max-width: min(76vw, 360px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

/* ---------- locatiedetail ---------- */
.location-details {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.location-details > h1,
.location-details > h2 {
  width: 100%;
  text-align: left;
}

.qr-code-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 0 28px;
}

.qr-code-container img {
  width: 150px;
  height: 150px;
  max-width: 100%;
  padding: 6px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.products-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-card h3 {
  max-width: 100%;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
}

.product-card p {
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  text-align: center;
}

.stock-control {
  display: grid;
  grid-template-columns: 44px minmax(72px, 110px) 44px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 210px;
  gap: 8px;
  margin-top: 18px;
}

.stock-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 0;
  color: #ffffff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.stock-control button:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.stock-control input {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 8px;
  color: var(--ink);
  background: #fcfdfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 16px;
  text-align: center;
}

/* ---------- modal ---------- */
.modal-content {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 55px rgba(14, 26, 38, 0.24);
}

.modal-header,
.modal-footer {
  border-color: var(--line-soft);
}

.modal-body .form-group {
  margin-bottom: 16px;
}

.modal .btn-close {
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px auto;
  padding: 10px;
  background-color: transparent;
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .sidebar {
    width: 236px;
    flex-basis: 236px;
  }

  .content > main.container {
    padding: 32px 28px 48px;
  }

  .content > main.container > .container > .row {
    grid-template-columns: minmax(0, 1fr);
  }

  .content > main.container > .container > .row > .col-md-8 .section > form {
    max-width: 720px;
  }
}

/* Brede tablet: navigatie bovenaan en volledig zichtbaar, zonder scrollstrook. */
@media (min-width: 769px) and (max-width: 900px) {
  .App {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    padding: 0 14px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-header {
    margin-bottom: 10px;
    padding: 16px 6px 14px;
  }

  .sidebar .nav::before {
    display: none;
  }

  .sidebar .nav {
    display: flex;
    flex-flow: row wrap !important;
    gap: 6px;
    overflow: visible;
  }

  .sidebar .nav-item {
    flex: 0 1 auto;
    margin: 0;
  }

  .sidebar .nav-link {
    padding: 9px 12px;
    white-space: normal;
  }
}

/* ---------- mobiel ---------- */
@media (max-width: 768px) {
  .App {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    max-height: 100vh;
    flex: 0 0 auto;
    padding: 0 16px;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-header {
    min-height: 68px;
    margin: 0;
    padding: 12px 0;
    border-bottom: 0;
  }

  .sidebar-header h3 {
    font-size: 14.5px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
    gap: 8px;
    padding: 9px 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
  }

  .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.13);
  }

  .mobile-menu-toggle-icon {
    display: inline-flex;
    flex-direction: column;
    width: 17px;
    gap: 4px;
  }

  .mobile-menu-toggle-icon::before,
  .mobile-menu-toggle-icon::after,
  .mobile-menu-toggle-icon span {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }

  .sidebar .nav::before {
    display: none;
  }

  /* Zonder custom.js blijft het menu zichtbaar: progressive enhancement. */
  .sidebar .nav {
    width: 100%;
    flex-direction: column !important;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0 0 12px;
    overflow: visible;
  }

  .sidebar.menu-enhanced .nav {
    display: none;
  }

  .sidebar.menu-enhanced.is-menu-open .nav {
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
  }

  .sidebar .nav-item {
    width: 100%;
    margin: 0;
  }

  .sidebar .nav-link {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    white-space: normal;
  }

  .content > main.container {
    width: 100%;
    padding: 22px 16px 40px;
  }

  .section {
    margin-bottom: 18px;
    padding: 20px 16px 22px;
    border-radius: 12px;
  }

  .section > h1,
  .section > h2,
  .section > h3,
  .location-details > h1,
  .location-details > h2 {
    margin-bottom: 18px;
    padding-bottom: 12px;
    font-size: 18px;
  }

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

  .section .btn,
  .section > .btn.mb-3 {
    width: 100%;
  }

  .section > ul > li,
  .list-group-item {
    padding: 13px 14px;
  }

  .location-list .location-item {
    min-height: 76px;
    gap: 12px;
  }

  .qr-code-container img {
    width: 128px;
    height: 128px;
  }

  .products-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .product-card {
    width: 100%;
    padding: 22px 16px;
  }

  .stock-control {
    max-width: 220px;
  }

  .modal-dialog {
    max-width: calc(100% - 24px);
    margin: 12px auto;
  }
}

@media (max-width: 420px) {
  .sidebar {
    padding: 0 14px;
  }

  .sidebar-header::before {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mobile-menu-toggle {
    padding-inline: 10px;
  }

  .content > main.container {
    padding-right: 14px;
    padding-left: 14px;
  }
}

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