/* ===================================== */
/* Base Reset & Global Styles            */
/* ===================================== */
@import url("../fonts/inter.css");
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  min-height: calc(100vh - 10px);
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at center, #265a78 0%, #0d202b 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================================== */
/* Navigation & Header                   */
/* ===================================== */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  margin: 20px auto;
  max-width: 1240px;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-item a, .nav-item span {
  display: block;
  padding: 8px 16px;
  font-weight: 600;
  color: white;
  background-color: #92836f;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.nav-item span{
  cursor: default;
}
.nav-item a:hover{
    background-color: #7f715e;
    color: white;
}
.active {
  background-color: #7f715e;
  color: white;
  outline: 2px solid #265a78;
  outline-offset: 2px;
  border-radius:3px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #92836f;
  color: white;
  border-top-left-radius: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 10px 0;
  margin: 0;
  margin-top: -3px;
  display: none;
  z-index: 100;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  padding: 0;
  white-space: nowrap;
}

/* Make <a> fill the li and carry the styles */
.dropdown-menu li a {
  display: block;
  padding: 8px 16px;
  border-radius:0;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

/* Hover effect on the link itself */
.dropdown-menu li a:hover {
  background-color: #7f715e;
}

/* Navigation actions */
.nav-actions {
  display: flex;
  align-items: center;
}

.nav-actions button {
  margin-left: 10px;
  padding: 8px 16px;
  background-color: #265a78;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.nav-actions button:hover {
  background-color: #1e4a63;
}

.nav-actions a {
  margin-left: 10px;
  padding: 8px 16px;
  background-color: #265a78;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
}

.nav-actions a:hover {
  background-color: #1e4a63;
}

.nav-username {
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d1dde8;
  background-color: #f3f7fb;
  color: #1e4a63;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
}

/* Main menu item when inactive */
.nav-item.inactive a {
  background-color: #b0b0b0; /* Light gray */
  color: #f5f5f5;
  cursor: default;
  pointer-events: none; 
}

.nav-item.inactive span {
  display: block;
  padding: 8px 16px;
  background-color: #b0b0b0;
  color: #f5f5f5;
  border-radius: 4px;
  cursor: default;
}

/* Hover state for inactive (optional, or remove entirely) */
.nav-item.inactive a:hover {
  background-color: #a0a0a0;
  color: #f5f5f5;
  cursor: default;
}

/* Submenu under inactive main item */
.nav-item.inactive .dropdown-menu {
  background-color: #b0b0b0;
  color: #f5f5f5;
  cursor: default;
}

/* Submenu links inside inactive */
.nav-item.inactive .dropdown-menu li a {
  background-color: #b0b0b0;
  color: #f5f5f5;
  cursor: default;
}

/* Optional: hover effect for submenu items under inactive */
.nav-item.inactive .dropdown-menu li a:hover {
  background-color: #a0a0a0;
  color: #f5f5f5;
  cursor: default;
}

/* ===================================== */
/* Layout Containers & Panels            */
/* ===================================== */
.content-box {
  background-color: white;
  margin: 20px auto;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  max-width: 1240px;
  color: #333;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-subtitle {
  margin: 0;
  color: #265a78;
  font-size: 1.1rem;
}

.dashboard-message-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.dashboard-panel {
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-panel h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #1e4a63;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.message-card {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-left: 6px solid #265a78;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.message-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.message-meta {
  font-size: 0.85rem;
  color: #627d98;
  font-weight: 600;
}

.message-card-header h4 {
  margin: 0;
  font-size: 0.85rem;
  color: #1e4a63;
  border-radius:20px;
  padding: 4px 10px;
}

.message-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background-color: #2f9cdb;
  color: #fff;
}

.message-card p {
  margin: 0;
  color: #324a5f;
  line-height: 1.5;
}

.message-card.level-critical {
  border-left-color: #d14343;
  background: #fff5f5;
}

.message-card.level-critical .message-badge {
  background-color: #d14343;
}

.message-card.level-warning {
  border-left-color: #f0b429;
  background: #fff8eb;
}

.message-card.level-warning .message-badge {
  background-color: #f0b429;
  color: #3d2f00;
}

.message-card.level-info {
  border-left-color: #2f9cdb;
  background: #f1f8ff;
}

.message-card.level-info .message-badge {
  background-color: #2f9cdb;
}

.message-card.level-neutral {
  border-left-color: #d9e2ec;
  background: #ffffff;
}

.message-card.level-neutral .message-badge {
  display: none;
}

.empty-state {
  margin: 0;
  color: #607182;
  font-style: italic;
}

.app-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-top: 1px solid #e0e6ed;
  padding-top: 12px;
  font-size: 0.9rem;
  color: #425466;
  margin-top: 24px;
}

.app-version {
  font-weight: 600;
}

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


/* Upload form & file controls */
.upload-form {
  --upload-control-height: 48px;
  display: grid;
  gap: 12px;
  align-items: end;
  font-family: 'Inter', sans-serif;
  margin: 20px 0;
}

/* File input container */
.upload-form input[type="file"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 14px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f5f5f5;
  color: #333;
  height: var(--upload-control-height);
  min-height: var(--upload-control-height);
  max-height: var(--upload-control-height);
}

/* Browse button inside file input */
.upload-form ::file-selector-button {
  height: calc(var(--upload-control-height) - 2px);
  min-height: calc(var(--upload-control-height) - 2px);
  box-sizing: border-box;
  padding: 0 16px;
  background-color: #92836f;
  color: white;
  border: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.upload-form ::file-selector-button:hover {
  background-color: #7f715e;
}

/* Upload button */
.upload-form button[type="submit"] {
  height: var(--upload-control-height);
  min-height: var(--upload-control-height);
  max-height: var(--upload-control-height);
  padding: 0 20px;
  background-color: #265a78;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  width: 100%;
  justify-self: stretch;
  grid-column: 1 / -1;
}

.upload-form button[type="submit"]:hover {
  background-color: #1e4a63;
}

.upload-form .settings-field {
  display: block;
  position: relative;
  min-width: 0;
  gap: 0;
}

.upload-file-tag {
  position: absolute;
  left: 10px;
  top: -9px;
  padding: 0 6px;
  background: #e8edf2;
  color: #324a5f;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.1;
  z-index: 1;
  pointer-events: none;
}

.upload-form-single {
  grid-template-columns: 1fr;
}

.upload-form-single input[type="file"] {
  border-radius: 4px;
}

.upload-form-single button[type="submit"] {
  border-radius: 4px;
}

.upload-form-three {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.upload-form-rbv {
  grid-template-columns: 1fr;
}

.upload-grid-two {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-form-rbv button[type="submit"] {
  justify-self: stretch;
}

@media (max-width: 1200px) {
  .upload-form-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-form-three button[type="submit"] {
    justify-self: stretch;
  }
}

@media (max-width: 900px) {
  .upload-form-single,
  .upload-form-three,
  .upload-grid-two {
    grid-template-columns: 1fr;
  }

  .upload-form-single input[type="file"] {
    border-radius: 4px;
  }

  .upload-form-single button[type="submit"],
  .upload-form-three button[type="submit"],
  .upload-form-rbv button[type="submit"] {
    width: 100%;
    justify-self: stretch;
    border-radius: 4px;
  }
}


/* Form & Grid Layout */
.form-section {
  margin-bottom: 0.5rem;
  margin-left: -10px;
  margin-right:-10px;
}

.grid-header,
.grid-row {
  display: grid;
  align-items: center;
}

/* Calculation Tables */
#bk-grid {
  display: grid;
  grid-template-columns: 140px 70px 70px 70px 110px 70px 100px 362px 100px 148px;
  grid-auto-rows: auto;
}

#prod-grid   {
  display: grid;
  grid-template-columns: 75px 75px 66px 66px 66px 66px 66px 66px 66px 66px 66px 66px 25px 118px 53px 53px 53px 75px 53px;
  grid-auto-rows: auto;
}

#frictie-settings-grid,
#herbekleden-settings-grid {
  display: grid;
  grid-template-columns: 140px 80px 1.2fr 0.7fr 1fr 2fr 0.9fr 0.9fr;
  grid-auto-rows: auto;
}

#herbekleden-settings-grid {
  grid-template-columns: 140px 110px 1fr 1fr 1fr 1fr 1fr 1fr;
}

#frictie-settings-grid .group-header-main,
#herbekleden-settings-grid .group-header-main {
  grid-column: 1 / 5;
}

#frictie-settings-grid .group-header-sub,
#herbekleden-settings-grid .group-header-sub {
  grid-column: 5 / 9;
}

#frictie-mat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
}

#herbekleden-mat-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-auto-rows: auto;
}

#frictie-mat-grid .group-header-main,
#herbekleden-mat-grid .group-header-main {
  grid-column: 1 / -1;
}

.group-header {
  background: #265a78;
  font-weight: bold;
  text-align: center;
  grid-column: 1 / -1;
  padding: 6px 0;
  border-bottom: 2px solid #ccc;
}

.field-header {
  background: #265a78;
  color:#fff;
  padding: 3px;
  border-right: 1px dotted #aaa;
  font-size:14px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  text-align: center;
}

.field-header.left{
  justify-content: left;
  text-align:left;
}

/* Tube summary grid */
#tube-summary,
.frictie-summary {
  margin-top: 1.5rem;
  overflow-x: auto;
  margin-left:-10px;
  margin-right:-10px;
}

#tube-summary .summary-grid {
  display: grid;
  grid-template-columns:
    230px
    minmax(70px, 1fr)   /* Aantal */
    minmax(70px, 1fr)   /* PR/STK */
    minmax(70px, 1fr)   /* Prijs */
    minmax(60px, 1fr)   /* Uren */
    minmax(70px, 1fr)   /* Indirekt */
    minmax(70px, 1fr)   /* Gewicht */
    360px               /* Basistubes */
    minmax(70px, 1fr)   /* Aantal tubes */
    minmax(80px, 1fr)   /* Voorraad */
    minmax(130px, 1.2fr);
  align-items: stretch;
  min-width: 1080px;
  width: 100%;
  font-size: 0.85rem;
}

.frictie-summary .summary-grid {
  display: grid;
  grid-template-columns:
    300px
    minmax(70px, 1fr)
    minmax(90px, 1fr)
    minmax(90px, 1fr)
    minmax(90px, 1fr)
    minmax(100px, 0.8fr);
  align-items: stretch;
  min-width: 720px;
  width: 100%;
  font-size: 0.85rem;
}

#tube-summary .summary-grid-head,
.frictie-summary .summary-grid-head {
  background-color: #265a78;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
}

#tube-summary .summary-grid-head .summary-cell,
.frictie-summary .summary-grid-head .summary-cell {
  justify-content: center;
  text-align: center;
}

#tube-summary .summary-grid-head .summary-col-product,
#tube-summary .summary-grid-head .summary-col-btube,
.frictie-summary .summary-grid-head .summary-col-product {
  justify-content: flex-start;
  text-align: left;
}

#tube-summary .summary-cell,
.frictie-summary .summary-cell {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: inherit;
  color: inherit;
  border-right:1px dotted #aaa;
  border-bottom:1px solid #aaa;
}

.frictie-summary .summary-grid + .summary-grid {
  margin-top: 4px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-row {
  background: #fff;
}

.summary-row-current {
  background-color: #265a78;
  font-weight: 600;
  color:#fff;
}

.summary-row-current .summary-cell {
  border-color: rgba(255, 255, 255, 0.25);
}

.summary-list .summary-row:nth-child(even) {
  background-color: #f9fbfd;
}

.summary-row-shortage {
  background-color: #fff0e6;
}

.summary-row-total {
  background-color: #e0e6ed;
  font-weight: 600;
}

.summary-row-total .summary-cell {
  border-color: #1f3f59;
}

.summary-row-total .summary-col-btube,
.summary-row-total [data-summary-total="tubeCount"],
.summary-row-total [data-summary-total="stock"],
.summary-row-total [data-summary-total="shortage"] {
  background-color: #255774;
  color: #fff;
  font-size: 12px;
}

.summary-row-total .summary-col-btube {
  justify-content: flex-start;
}

.summary-col-product,
.summary-col-btube {
  text-align: left;
}

.summary-col-product {
  min-width: 230px;
  max-width: 230px;
}

.summary-col-btube {
  min-width: 360px;
  max-width: 360px;
}

.frictie-summary .summary-col-product {
  min-width: 300px;
  max-width: 300px;
}

.frictie-summary .summary-col-actions {
  width: 110px;
}

.summary-col-number {
  text-align: right;
  white-space: nowrap;
}

.summary-cell.summary-col-number {
  justify-content: flex-end;
}

.summary-cell.summary-col-product,
.summary-cell.summary-col-btube {
  justify-content: flex-start;
}

.summary-cell.summary-col-actions {
  justify-content: center;
  border:0;
  font-size:12px;
}

.summary-col-actions {
  text-align: center;
  width: 90px;
}

.summary-shortage {
  color: #b3261e;
  font-weight: 600;
}

#tube-summary .btn,
.frictie-summary .btn {
  font-size: 0.8rem;
  padding: 6px 12px;
}

#tube-summary .btn-save,
.frictie-summary .btn-save {
  background-color: #f5c400;
  color: #1b1b1b;
}

#tube-summary .btn-remove,
.frictie-summary .btn-remove {
  background-color: #265a78;
}

.modal .btn-save {
  background-color: #3b9e6f;
  color: #f4fff9;
}

.modal .btn-remove {
  background-color: #c74343;
  color: #fff;
}

#tube-summary .btn[disabled],
.frictie-summary .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.frictie-summary .summary-row-total .btn {
  background-color: #2c4054;
  color: #fff;
}

.summary-purchase {
  display: flex;
  flex-direction: column;
  gap: 2px;  
  min-height: 30px;
}

.summary-purchase .btn{
  width: 230px;
  font-size: 1em !important;
  min-height: 35px;
  border-radius: 0;
  border-bottom-right-radius: 5px;
  position:absolute;
}

.summary-purchase.is-hidden {
  display: none;
}

.dkbg{
  background-color:#265a78 !important;
  color:#fff !important;
  font-size:12px;
}

.summary-purchase-row {
  display: grid;
  grid-template-columns:
    230px
    minmax(70px, 1fr)
    minmax(70px, 1fr)
    minmax(70px, 1fr)
    minmax(60px, 1fr)
    minmax(70px, 1fr)
    minmax(70px, 1fr)
    360px
    minmax(70px, 1fr)
    minmax(80px, 1fr)
    90px;
  align-items: stretch;
  min-width: 1080px;
  width: 100%;
  font-size: 0.85rem;
}

.summary-purchase-row .summary-cell {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #e0e6ed;
  color: #1b1b1b;
  border-right: 2px dotted #1f3f59;
  border-bottom: 2px dotted #1f3f59;
}

.summary-purchase-row:last-child .summary-cell {
  border-bottom: 0;
}

.no-border{
  border:0 !important;
}

.summary-purchase-col-blank {
  background: #e0e6ed;
  border:0 !important;
}

.summary-purchase-col-1 {
  grid-column: 1 / 2;
  border-left: 0;
  justify-content: flex-start;
}

.summary-purchase-col-2 {
  grid-column: 2 / 3;
}

.summary-purchase-col-3 {
  grid-column: 3 / 4;
}

.summary-purchase-col-4 {
  grid-column: 4 / 5;
}

.summary-purchase-col-5 {
  grid-column: 5 / 6;
}

.summary-purchase-col-6 {
  grid-column: 6 / 7;
}

.summary-purchase-col-7 {
  grid-column: 7 / 8;
  border-right:2px dotted #7f715e !important;
}

.summary-purchase-col-blank.summary-cell {
  justify-content: flex-end;
  text-align: right;
}

.summary-purchase-col-1.summary-cell {
  justify-content: flex-start;
  text-align: left;
}

.summary-purchase-col-product {
  grid-column: 8 / 9;
  justify-content: flex-start;
  background-color: #255774;
  color: #fff;
  font-size: 12px;
}

.summary-purchase-col-needed {
  grid-column: 9 / 10;
  justify-content: flex-end;
  text-align: right;
  background-color: #255774;
  color: #fff;
  font-size: 12px;
}

.summary-purchase-col-stock {
  grid-column: 10 / 11;
  justify-content: flex-end;
  text-align: right;
  background-color: #255774;
  color: #fff;
  font-size: 12px;
}

.summary-purchase-col-action {
  grid-column: 11 / 12;
  justify-content: center;
  background-color: #255774;
  color: #fff;
  font-size: 12px;
  border-right: 0;
}

.summary-purchase-action-order {
  color: #d14343 !important;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-purchase-action-ok {
  color: #1e4a63;
  font-weight: 600;
}

.calc-grid h4{
  margin-bottom:0;
}

/* Tube-specific inputs */
.tube-form input,
.frictie-form input,
.frictie-form select {
  width: 100%;
  padding: 2px 4px;
  box-sizing: border-box;
  border-top:1px solid #adadad;
  border-bottom:1px solid #adadad;
  border-right:1px solid #adadad;
  border-left:0;
  border-radius:0;
}
.tube-form input:focus,
.frictie-form input:focus,
.frictie-form select:focus {
  border-bottom:1px solid #265a78;
  box-shadow:0 2px 0 0 #265a78;
  background-color: #f0f8ff;
  outline: none;
}

.tube-form input.is-error,
.frictie-form input.is-error,
.frictie-form select.is-error {
  border-color: #ee0000 !important;
  box-shadow: none !important;
}

.tube-form input.is-valid,
.frictie-form input.is-valid,
.frictie-form select.is-valid {
  border-color: #00b050 !important;
  box-shadow: none;
}

.form-message {
  display: none;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fde8e8;
  border-left: 4px solid #ee0000;
  color: #5b1a1a;
  font-size: 0.95rem;
}

.form-message.visible {
  display: block;
}
.form-message .form-error-item + .form-error-item {
  margin-top: 6px;
}

/* Utility alignment */
input.center{
  text-align: center;
}

/* Positioning both headers */
.group-header-main {
  background: #265a78;
  color:#fff;
  padding: 4px 0;
  border-bottom: 1px dotted #aaa;
  border-right: 1px dotted #aaa;
  padding: 3px;
  font-size:13px;
  text-transform: uppercase;
}

.group-header-sub {
  background: #265a78;
  color:#fff;
  padding: 4px 0;
  border-bottom: 1px dotted #aaa;
  padding: 3px;
  font-size:13px;
  text-transform: uppercase;
}

.group-header-mini{
  background: #265a78;
  color:#fff;
  padding: 4px 0;
  border-bottom: 1px dotted #aaa;
  border-right: 1px dotted #aaa;
  padding: 3px;
  font-size:13px;
  text-transform: uppercase;
}

#bk-grid .group-header-main {
  grid-column: 1 / 7;
}

#bk-grid .group-header-sub {
  grid-column: 7 / 11;
}

#prod-grid .group-header-main {
  grid-column: 1 / 9;
}

#prod-grid .group-header-sub {
  grid-column: 13 / 20;
}

#prod-grid .c10 {
  grid-column: 9 / 10;
}

#prod-grid .c11 {
  grid-column: 10 / 11;
}

#prod-grid .c12 {
  grid-column: 11 / 12;
}
#prod-grid .c13 {
  grid-column: 12 / 13;
}
/* Borderless helper */
.noborder{
  border:0;
}

/* Display-only overlay */
.display-input {
  position: relative;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Disabled & readonly controls */
input:disabled,
textarea:disabled,
select:disabled {
  background-color: #f0f0f0;   /* light gray background */
  color: #000;                 /* muted text color */
  border: 1px solid #ccc;      /* subtle border */
  cursor: not-allowed;         /* shows disabled cursor */
  opacity: 1;                  /* override browser default fade */
}
input[readonly],
textarea[readonly] {
  background-color: inherit;
  color: inherit;
  cursor: default;
  opacity: 1;
}


/* Calculation layout */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  font-family: sans-serif;
  font-size: 12px;
  align-items: start;
}

.calc-grid.frictie-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}


.calc-grid input{
  border: 1px solid #f0f0f0;
}

.calc-col {
  display: flex;
  flex-direction: column;
}

.calc-section-body {
  display: flex;
  flex-direction: column;
}

.calc-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  border-bottom:#aaaaaa 1px solid;
  font-weight:bold;
}

.calc-row input {
  width: 100%;
  text-align: right;
  padding: 2px 4px;
}

h4 {
  margin-top: 0.7rem;
  margin-bottom: 0.3rem;
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
  background: #e0e0e0;
  padding: 3px 5px;
}

.deeltube-wrapper {
  overflow-x: auto;
  margin-bottom: 0.05rem;
}

.deeltube-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.deeltube-table th,
.deeltube-table td {
  border: 1px solid #cfcfcf;
  padding: 4px 6px;
  text-align: center;
  background: #fff;
}

.deeltube-table thead th {
  background: #e5e5e5;
  font-weight: 600;
  text-transform: uppercase;
}

.deeltube-table thead tr:first-child th {
  background: #d7d7d7;
  font-size: 0.7rem;
}

.deeltube-table tbody th {
  background: #f5f5f5;
  font-weight: 600;
  text-align: left;
  padding-left: 8px;
}

.deeltube-table input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: right;
  padding: 0;
  font-size: 0.73rem;
  color: inherit;
}

.deeltube-table input:disabled {
  color: inherit;
}

/* Optional for clearer visual grid lines */
.calc-grid, .calc-col, .calc-row {
  border-collapse: collapse;
}

.calc-grid input:disabled{
  cursor:default;
}
.calc-grid input.beitel-warning,
.calc-grid input.beitel-warning:disabled {
  background-color: #f5c400;
  border-color: #d6b400;
}
.calc-grid #ppp, .calc-grid #ppe{
  font-weight:bold;
  font-size:1rem;
}
.calc-row label {
  text-align: left;
}

/* Custom dropdown styling */

.c-dropdown {
  position: relative;
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  display: none;
  z-index: 10;  
  white-space: nowrap;       /* Prevents wrapping so width grows with content */
  width: auto;               /* Let content define the width */
  min-width: 100%;
}

.dropdown-options.open {
  display: block;
}

.dropdown-options span {
  display: block;
  width: 100%;
  cursor: pointer;
}
.dropdown-options span.dropdown-option {
  display: grid;
  grid-template-columns: 22px 120px 53px 53px 53px 75px 52px;
  gap: 0;
  align-items: stretch;
  border-collapse: collapse;
}
.dropdown-option-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ccc;
  background-color: #fff;
  text-align: center;
}
.dropdown-option-cell.dropdown-cell-type {
  justify-content: flex-start;
}
.dropdown-options span.dropdown-option-best .dropdown-option-cell {
  background-color: #e1f1ff;
  border-color: #b3d6f7;
  color: #1b3c57;
}
.dropdown-option-cell-best {
  background-color: #e1f1ff;
  border-color: #b3d6f7;
  color: #1b3c57;
}
.dropdown-options span.dropdown-option-best:hover,
.dropdown-options span.dropdown-option-best.highlighted {
  background-color: #4a8ccf;
  color: #fff;
}
.dropdown-options span.dropdown-option-best:hover .dropdown-option-cell,
.dropdown-options span.dropdown-option-best.highlighted .dropdown-option-cell {
  background-color: #4a8ccf;
  border-color: #2f6cad;
  color: #fff;
}
.dropdown-options span.dropdown-option-best:hover .dropdown-option-cell.dropdown-option-highlight,
.dropdown-options span.dropdown-option-best.highlighted .dropdown-option-cell.dropdown-option-highlight {
  background-color: #2f6cad;
  border-color: #244f7f;
}
.dropdown-option-highlight {
  background-color: #d9534f;
  color: #fff;
  border-color: #b52b27;
}
.dropdown-options span:hover .dropdown-option-cell,
.dropdown-options span.highlighted .dropdown-option-cell {
  background-color: #92836f;
  border-color: #6f5c45;
  color: #fff;
}
.dropdown-options span:hover .dropdown-option-cell.dropdown-option-highlight,
.dropdown-options span.highlighted .dropdown-option-cell.dropdown-option-highlight {
  background-color: #c9302c;
  border-color: #a02724;
}
.dropdown-options span:hover {
  background: #92836f;
  color:#fff;
}
.dropdown-options span.highlighted {
  background-color: #92836f;
  color:#fff;
}
.handmatig{
  text-align:center;
}
.c-dropdown.is-disabled .dropdown-input,
.c-dropdown .dropdown-input[disabled] {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===================================== */
/* Authentication Pages                  */
/* ===================================== */
.login-page .login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-page .login-box {
  background-color: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  width: 380px;
  text-align: center;
}

.login-page .login-box input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f5f5f5;
  font-size: 14px;
}

.login-page .login-box input:focus {
  outline: 2px solid #92836f;
}

.login-page .login-box button {
  width: 100%;
  padding: 10px;
  background-color: #265a78;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.login-page .login-box button:hover {
  background-color: #1e4a63;
}

/* ===================================== */
/* Settings Layout                       */
/* ===================================== */
.settings-layout {
  display: grid;
  grid-template-columns: 20% 1fr;
  gap: 20px;
}

.settings-sidebar {
  background-color: #f7f7f7;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.settings-sidebar h2 {
  margin-top: 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #265a78;
}

.settings-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-sidebar li {
  margin-bottom: 12px;
}

.settings-sidebar a {
  display: block;
  padding: 8px 12px;
  color: #265a78;
  text-decoration: none;
  font-weight: 600;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.settings-sidebar a:hover {
  background-color: rgba(38, 90, 120, 0.1);
  text-decoration: none;
}

.settings-sidebar a.active {
  background-color: #265a78;
  color: #fff;
}

.settings-content {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section h3 {
  margin-top: 0;
  color: #265a78;
}

.settings-section p {
  margin: 0;
  line-height: 1.5;
}

.settings-readonly-form,
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.settings-readonly-form fieldset,
.settings-form fieldset {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
}

.settings-readonly-form legend,
.settings-form legend {
  padding: 0 8px;
  font-weight: 600;
  color: #265a78;
}

.settings-readonly-grid,
.settings-grid {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-readonly-grid label,
.settings-grid label {
  font-size: 0.85rem;
  color: #4a5b6a;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.settings-readonly-grid input,
.settings-grid input,
.settings-grid select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d9e2ec;
  border-radius: 4px;
  background-color: #f8fafc;
  color: #324a5f;
  font-size: 0.95rem;
}

.settings-readonly-grid input[readonly] {
  cursor: not-allowed;
}

.settings-grid .settings-comment {
  font-size: 0.75rem;
  font-weight: normal;
  color: #6b7c8a;
  margin-bottom: 6px;
}
.settings-field {
  display: flex;
  flex-direction: column;
}

.settings-field select.readonly,
.settings-field input.readonly,
.settings-field input:disabled,
.settings-field select:disabled {
  cursor: not-allowed;
  background-color: #f1f4f7;
  color: #9aa8b6;
  border-color: #d1dce6;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.settings-actions .btn.primary {
  background-color: #92836f;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.settings-actions .btn.primary:hover {
  background-color: #7f715e;
}

.form-actions .btn.primary {
  background-color: #92836f;
  color: #fff;
}

.form-actions .btn.primary:hover {
  background-color: #7f715e;
}


.helper-text {
  font-size: 0.85rem;
  color: #666;
  margin: 6px 0 14px 0;
}

.settings-hint {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 12px 0;
}

.meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 12px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: #324a5f;
  gap: 4px;
}

.form-grid .form-actions {
  display: flex;
  align-items: flex-end;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  padding: 8px 10px;
  border: 1px solid #d9e2ec;
  border-radius: 4px;
  font-size: 0.95rem;
  color: #2b4a60;
  background-color: #f8fafc;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form.compact input {
  max-width: 140px;
  padding: 6px 8px;
}

.inline-form.compact .btn {
  padding: 6px 12px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e1eaf2;
  vertical-align: middle;
}

.users-table th {
  font-weight: 600;
  color: #2b4a60;
  background-color: #f4f7fa;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.tube-editor-input {
  width: 90px;
  padding: 4px 6px;
  font-size: 0.95rem;
}

.tube-editor-price {
  width: 120px;
}

.tube-editor-stock {
  width: 70px;
}

.user-ident {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-ident .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #265a78;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-transform: uppercase;
}

.user-ident .name {
  font-weight: 600;
  color: #1f2f3d;
}

.admin-message-item {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 16px;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}

.admin-message-item form + form {
  margin-top: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.card {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 16px;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2b4a60;
  margin: 0;
}

.card-meta {
  font-size: 0.85rem;
  color: #7a8593;
}

.alert.info {
  background-color: #e6f4ff;
  color: #265a78;
}

.alert.success {
  background-color: #e8f7ee;
  color: #246a43;
}

.alert.warning {
  background-color: #fdecea;
  color: #9f3a38;
}

.alert-technical {
  font-size: 0.5em;
  margin-top: 6px;
}

.db-import-tabs {
  margin-top: 10px;
}

.db-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.db-tab-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.db-tab-label {
  padding: 8px 12px;
  border: 1px solid #c9d7e4;
  border-radius: 6px;
  background-color: #f5f8fb;
  color: #30506a;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.db-tab-panel {
  display: none;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 14px;
  background-color: #ffffff;
}

.backup-title {
  margin: 18px 0 8px 0;
  color: #2b4a60;
  font-size: 0.95rem;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background-color: #f9fbfd;
}

.backup-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.backup-restore-btn {
  width: auto;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

#db-tab-tubes:checked ~ .db-tab-list label[for="db-tab-tubes"],
#db-tab-frictie:checked ~ .db-tab-list label[for="db-tab-frictie"],
#db-tab-frictie-rbv:checked ~ .db-tab-list label[for="db-tab-frictie-rbv"] {
  background-color: #265a78;
  border-color: #265a78;
  color: #ffffff;
}

#db-tab-tubes:checked ~ .db-tab-panel-tubes,
#db-tab-frictie:checked ~ .db-tab-panel-frictie,
#db-tab-frictie-rbv:checked ~ .db-tab-panel-frictie-rbv {
  display: block;
}

@media (max-width: 900px) {
  .backup-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .backup-restore-btn {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}


.btn {
  padding: 8px 16px;
  background-color: #265a78;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background-color: #1e4a63;
}

.btn[disabled],
.btn:disabled {
  background-color: #9aa8b6;
  border-color: #9aa8b6;
  color: #e9eef2;
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
  pointer-events: none;
}

#mat_ppm, #prijs_pp, #prijs_pe{
  font-size:1rem;
  font-weight:bold;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 25, 44, 0.6);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
  max-width: 28rem;
  width: 100%;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.modal-content p {
  margin: 0;
  color: #3b4758;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.priority-badge {
  background-color: #e1eaf2;
  color: #2b4a60;
}
.priority-3 {
  background-color: #ffe4b5;
  color: #8a6116;
}
.priority-4 {
  background-color: #ffd4d1;
  color: #a73427;
}
.priority-5 {
  background-color: #ffb3ae;
  color: #7a1b12;
}
