@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =====================================================
   VARIABELEN
   ===================================================== */
:root {
  --dark: #006B84;
  --yellow: #F7D400;
  --light: #E3E2D7;
  --white: #ffffff;
  --text-dark: #2C2F33;
  --text-muted: #6b7280;
  --border: #d4d7e0;
  --font: 'Inter', sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: #f2f4f7;
  color: var(--text-dark);
}

button,
input,
select,
textarea {
  font-family: var(--font);
}

/* =====================================================
   LOGIN STATE
   ===================================================== */
body.login-active {
  background: var(--dark);
}

body.login-active #appWrapper,
body.login-active .main-header {
  display: none;
}

body:not(.login-active) .login-screen {
  display: none;
}

/* =====================================================
   HEADER
   ===================================================== */
.main-header {
  background: var(--dark);
  border-bottom: 4px solid var(--yellow);
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-menu {
  display: flex;
  gap: 20px;
}

.header-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.header-menu a:hover {
  color: var(--yellow);
}

.logout-btn {
  background: transparent;
  border: 2px solid var(--yellow);
  padding: 8px 14px;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}

/* =====================================================
   PAGINA / LAYOUT
   ===================================================== */
.page-section {
  padding: 28px;
}

.pdf-page-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 560px;
  gap: 20px;
  align-items: start;
}

/* =====================================================
   LINKER SIDEBAR – IDENTIEK AAN OFFERTE
   ===================================================== */
.pdf-left {
  background: #ffffff;
  padding: 18px;
  border-radius: 14px;
  border: 2px solid var(--yellow);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
}

/* Titel */
.pdf-left > strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Dunne lijn onder titel (zoals offerte) */
.pdf-left > strong::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--border);
  margin-top: 8px;
  margin-bottom: 12px;
}

/* ❌ geen bullets */
.pdf-left ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pdf-left li {
  margin: 0;
  padding: 0;
}

/* Tiles */
.pdf-left .pdf-tile {
  display: block;
  width: 100%;
  text-align: left;

  background: #fff;
  padding: 12px 14px;
  margin-bottom: 10px;

  border-radius: 10px;
  border: 1px solid var(--border);

  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
}

/* Hover */
.pdf-left .pdf-tile:hover {
  background: #fffbe6;
  border-color: var(--yellow);
}

/* Actief */
.pdf-left .pdf-tile.active {
  background: #fff7c2;
  border-color: var(--yellow);
  font-weight: 600;
}

/* =====================================================
   MIDDEN – PRIJSLIJST VIEWER
   ===================================================== */
.pdf-center {
  min-width: 0;
}

.pdf-viewer {
  background: #ffffff;

  /* 🔥 zelfde uitstraling als header */
  border: 2px solid var(--dark);
  border-radius: 14px;

  padding: 14px;

  max-height: calc(100vh - 180px);
  overflow-x: auto;
  overflow-y: auto;
}


/* =====================================================
   PRIJSLIJST TABEL
   ===================================================== */
#priceListContainer table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  background: #ffffff;
  margin-bottom: 24px;
  font-size: 12.5px;
}

/* ===============================
   ALLE CELLEN: strak houden
   =============================== */
#priceListContainer th,
#priceListContainer td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  line-height: 1.35;
  vertical-align: top;

  /* 🔒 standaard: NIET afbreken */
  white-space: nowrap;
}

/* Kolomkoppen */
#priceListContainer th {
  background: #f5f7fb;
  font-weight: 600;
  text-align: center;
  font-size: 12px;
}

/* ===============================
   EERSTE KOLOM: MAG AFBREKEN
   =============================== */
#priceListContainer th:first-child,
#priceListContainer td:first-child {
  min-width: 140px;
  max-width: 180px;
  text-align: left;
  font-weight: 600;
  background: #fafbfc;

  /* ✅ hier mag tekst wél afbreken */
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ===============================
   PRIJS-CELLEN
   =============================== */
td.price-cell {
  text-align: right;
  font-weight: 600;
  cursor: pointer;
}

td.price-cell:hover {
  background: #fff3a0;
}

td.price-cell.price-selected {
  background: #ffe86a;
}


/* =====================================================
   RECHTER SIDEBAR – OFFERTE
   ===================================================== */
.offerte-box {
  background: #ffffff;
  padding: 18px;
  border-radius: 14px;
  border: 2px solid var(--yellow);
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  width: 560px;
}

.offerte-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
}

.offerte-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* =====================================================
   OFFERTE – REGELS
   ===================================================== */
.offerte-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.offerte-row strong {
  font-size: 15px;
  font-weight: 600;
}

.offerte-row .offerte-meta {
  font-size: 14px;
  font-weight: 500;
  margin-top: 2px;
}

.offerte-row .offerte-unit-price {
  font-size: 13px;
  color: var(--text-muted);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {
  .pdf-page-layout {
    grid-template-columns: 1fr;
  }

  .pdf-left,
  .offerte-box {
    position: static;
    width: auto;
    max-height: none;
  }
}
/* Drag feedback sidebar */
.pdf-tile.dragging {
  opacity: 0.4;
}

.pdf-tile.drag-over {
  border-color: var(--yellow);
  background: #fffbe6;
}
