/* =====================================================================
   🔵 ABCB UI 3.0 — COMPLETE CLEANED & UPGRADED STYLE.CSS
   ===================================================================== */

/* ------------------------------------------------------------
   BASIS
------------------------------------------------------------ */
* { box-sizing: border-box; }

:root {
  --bg-color: #f9fafb;
  --text-color: #333;
  --sidebar-bg: #f3f4f6;
  --sidebar-link: #333;
  --sidebar-hover: #e2e8f0;
  --topbar-bg: #f3f4f6;
  --btn-primary: #2954cc;
  --btn-primary-hover: #1e3a8a;
}

.dark-mode {
  --bg-color: #696666;
  --text-color: #ddd;
  --sidebar-bg: #2d2d2d;
  --sidebar-link: #ccc;
  --sidebar-hover: #3a3a3a;
  --topbar-bg: #111;
  --btn-primary: #3b82f6;
  --btn-primary-hover: #1d4ed8;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
}

a {
  color: #2954cc;
  text-decoration: none;
}

/* ------------------------------------------------------------
   FLASH BERICHTEN
------------------------------------------------------------ */
.flash {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  color: #fff;
  animation: fadein 0.3s ease;
}
.flash-success { background: #2e7d32; }
.flash-error   { background: #d32f2f; }
@keyframes fadein { from { opacity:0; } to { opacity:1; } }


/* ------------------------------------------------------------
   TOPBAR
------------------------------------------------------------ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  background: var(--topbar-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  z-index: 1000;
}
.logo-header { height: 42px; }

/* ------------------------------------------------------------
   SIDEBAR
------------------------------------------------------------ */
.sidebar{
  position: fixed;
  top: 68px;
  left: 0;
  width: 250px;
  height: calc(100vh - 68px);
  background: var(--sidebar-bg);
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  z-index: 900;
}

/* link basis */
.sidebar nav a{
  display:block;
  padding:12px 22px;
  color: var(--sidebar-link);
  font-size:15px;
  position:relative;

  border-left:4px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

/* hover */
.sidebar nav a:hover{
  background: var(--sidebar-hover);
}

/* active */
.sidebar nav a.active{
  background: var(--sidebar-hover);
  font-weight:800;
  border-left-color: var(--btn-primary);
  color: var(--btn-primary);
}

/* icon ook blauw bij active */
.sidebar nav a.active i{
  color: var(--btn-primary);
}

/* kleine indicator rechts */
.sidebar nav a.active::after{
  content:"";
  position:absolute;
  right:10px;
  top:50%;
  width:8px;
  height:8px;
  transform: translateY(-50%);
  border-radius:50%;
  background: var(--btn-primary);
}

/* ------------------------------------------------------------
   CONTENT / LAYOUT
------------------------------------------------------------ */
.layout { display: flex; margin-top: 68px; }

.content {
  flex: 1;
  margin-left: 250px;
  padding: 20px 30px;
  background: var(--bg-color);
}


/* ------------------------------------------------------------
   PAGE HEADER + ACTIONS
 ------------------------------------------------------------ */
.page-header,
.page-header-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  margin-bottom: 14px;
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
}

/* Titel links */
.page-header h2,
.page-header-bar h2{
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Rechterkant: zoek + knoppen */
.header-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Zoekformulier = 1 flexblok */
.header-actions form,
.header-actions .header-search{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Zoekveld – mag krimpen, voorkomt springen */
.header-actions input[type="text"],
.header-actions input[type="search"]{
  width: 260px;
  min-width: 160px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Knoppen nooit rekken */
.header-actions .btn{
  flex: 0 0 auto;
}

/* ======================
   RESPONSIVE
====================== */
@media (max-width: 900px){
  .page-header,
  .page-header-bar{
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .header-actions{
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
  }

  .header-actions form,
  .header-actions .header-search{
    width: 100%;
  }

  .header-actions input[type="text"],
  .header-actions input[type="search"]{
    width: 100%;
  }
}

/* ------------------------------------------------------------
   FIX: header-actions zoek + knoppen altijd netjes rechts (klanten.php)
------------------------------------------------------------ */
.header-actions{
  flex-wrap: nowrap;
  width: auto;
}

/* Zoekform als 1 blok naast de knop */
.header-actions .header-search{
  display:flex;
  align-items:center;
  gap:8px;
  flex: 0 1 auto;
  margin:0;
}

/* Input mag krimpen → voorkomt “springen” */
.header-actions .header-search input[type="text"],
.header-actions .header-search input[type="search"]{
  min-width: 180px;     /* belangrijk: lager dan 240 */
  width: 260px;         /* standaard breedte */
  flex: 1 1 260px;      /* mag kleiner worden */
}

/* Buttons nooit uitrekken */
.header-actions .btn{
  flex: 0 0 auto;
}

/* Tablet/smaller: dan mag het wél wrappen */
@media (max-width: 900px){
  .header-actions{
    flex-wrap: wrap;
    width:100%;
    justify-content:flex-start;
  }
  .header-actions .header-search{
    width:100%;
  }
  .header-actions .header-search input[type="text"],
  .header-actions .header-search input[type="search"]{
    width:100%;
  }
}

/* ------------------------------------------------------------
   TWO COLUMN FORM (cards naast elkaar)
------------------------------------------------------------ */
.two-column-form{
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: start;
}

/* Tegel-styling (kaartgevoel) */
.two-column-form .card{
  background:#fff;
  border-radius:12px;
  padding:18px;
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
}

/* Mobiel: onder elkaar */
@media (max-width: 900px){
  .two-column-form{
    grid-template-columns: 1fr;
  }
}


/* ------------------------------------------------------------
   KNOPPEN
------------------------------------------------------------ */
.btn {
  background: var(--btn-primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: var(--btn-primary-hover); }

.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }

.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }


/* ------------------------------------------------------------
   ACTIE ICONEN — ABCB STYLE (📄 ✏️ 💾 🗑)
------------------------------------------------------------ */
.action-icon {
  background: transparent;
  border: none;
  padding: 7px;
  cursor: pointer;
  margin: 0 4px;
  font-size: 18px !important;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform .15s, opacity .15s;
}
.action-icon i {
  color: #555 !important;
  font-size: 18px !important;
}
.action-icon:hover {
  transform: scale(1.20);
  opacity: 0.7;
}
.data-table td.actions .action-icon { font-size: 18px !important; }
.save-icon { font-size: 18px !important; vertical-align: middle; }


/* ------------------------------------------------------------
   TABELLEN
------------------------------------------------------------ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin-top: 15px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.data-table th, .data-table td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
}

.data-table th {
  background: #f3f4f6;
  font-weight: 600;
}

.data-table tr:nth-child(even) { background: #fafafa; }

.data-table td.actions {
  text-align: center !important;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Planboard – Assistent werkbon (read-only blok)
------------------------------------------------------------ */
.fc-event.wb-assistent,
.wb-assistent .fc-event-main,
.wb-assistent .fc-timeline-event,
.wb-assistent .fc-event-main-frame {

  background-color:#9ca3af !important;   /* grijs */
  border-color:#9ca3af !important;
  color:#111 !important;

  opacity:0.85;
  cursor:not-allowed !important;

  /* visueel meer "tijdblok" */
  box-shadow:none !important;
}

/* titel iets rustiger */
.wb-assistent .fc-event-title {
  font-weight:600;
  opacity:0.85;
}

/* ------------------------------------------------------------
   FORMULIEREN
------------------------------------------------------------ */
form label {
  font-weight: bold;
  margin-top: 10px;
  display: inline-block;
}

form .form-row label { display: block; }

form input,
form select,
form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}


/* ------------------------------------------------------------
   CARD
------------------------------------------------------------ */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}


/* ------------------------------------------------------------
   POPUP
------------------------------------------------------------ */
.abcb-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.abcb-popup {
  background: #fff;
  padding: 26px;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
}


/* ------------------------------------------------------------
   TOOLTIP
------------------------------------------------------------ */
[data-tooltip] { position: relative; }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
[data-tooltip]:hover::after { opacity: 1; }


/* ------------------------------------------------------------
   STATUS BADGES
------------------------------------------------------------ */
.status-badge {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  min-width: 90px;
  text-align: center;
}
.status-badge.groen  { background: #28a745; }
.status-badge.oranje { background: #ff9800; }
.status-badge.rood   { background: #dc3545; }


/* ------------------------------------------------------------
   SYSTEEMBEHEER — TOGGLE ICONS
------------------------------------------------------------ */
.toggle-icon-wrap { display: flex; justify-content: center; }

.toggle-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #bdbdbd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s;
  color: #fff;
  font-size: 16px;
}
.toggle-icon.on  { background:#2954cc; }
.toggle-icon.off { background:#bdbdbd; }
.toggle-icon i { pointer-events:none; }

<style>
/* 🔹 Compacte rechten-tabel */
.rights-table {
    font-size: 13px;
}

.rights-table th,
.rights-table td {
    padding: 6px 6px;
}

.rights-table th {
    background: #f8fafc;
    font-weight: 600;
}

.rights-table td {
    text-align: center;
}

/* Module kolom iets breder, maar compact */
.rights-table td:first-child,
.rights-table th:first-child {
    text-align: left;
    font-weight: 600;
    width: 180px;
    white-space: nowrap;
}

/* Checkbox kleiner en strakker */
.recht-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Minder ruimte onder cards */
.card {
    padding: 12px 14px;
}

/* Header iets compacter */
.page-header h2 {
    font-size: 18px;
    margin-bottom: 6px;
}

/* Knop compacter */
.form-actions .btn {
    padding: 6px 14px;
    font-size: 13px;
}
</style>

/* ------------------------------------------------------------
   CARD ACTIONS TOP-RIGHT (knoppen rechtsboven in card/form)
------------------------------------------------------------ */
.leverancier-bewerk{ position: relative; }

.card-actions-topright{
  position:absolute;
  top:12px;
  right:12px;
  display:flex;
  gap:10px;
  align-items:center;
  z-index:2;
}

/* Zorg dat de form niet onder de knoppen kruipt */
.leverancier-bewerk .form-card{
  padding-top:48px;
}

/* ------------------------------------------------------------
   STORINGEN
------------------------------------------------------------ */
.date-cell{
  white-space:nowrap;
  font-weight:600;
}

.btn{
  padding:10px 12px;
  border-radius:10px;
  border:0;
  cursor:pointer;
  font-weight:700;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition:background-color .15s ease, color .15s ease;
}

/* Primary (blauw) */
.btn-primary{
  background:#2954cc;
  color:#fff;
}
.btn-primary:hover{
  background:#1f3fa6;
  color:#fff;
}

/* Secondary (grijs) */
.btn-secondary,
.btn-ghost{
  background:#f3f4f6;
  color:#111827;
}
.btn-secondary:hover,
.btn-ghost:hover{
  background:#e5e7eb;
  color:#111827;
}

/* Accent (optioneel) */
.btn-accent{
  background:#2563eb;
  color:#fff;
}
.btn-accent:hover{
  background:#1d4ed8;
}

.two-column-form.storing-2col{
  grid-template-columns: 60% 40%;
}
@media (max-width: 900px){
  .two-column-form.storing-2col{
    grid-template-columns: 1fr;
  }
}

/* ===============================
   Werkbon – Werkomschrijving (3 kolommen)
=============================== */
.werk-3col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media(max-width: 1000px){
  .werk-3col{ grid-template-columns: 1fr; }
}

.werk-3col label{
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.werk-3col textarea{
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

.werk-3col .read-only{
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  padding: 10px;
  border-radius: 8px;
  min-height: 150px;
  white-space: pre-wrap;
}

/* Mobiel */
@media (max-width: 900px){
  .werk-3col{
    grid-template-columns: 1fr;
  }
}

/* Header icon actions (zelfde als tabel acties) */
.header-actions-icons{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;
}

/* Nettere rij icon-actions in werkbon_detail artikelen */
.actions-inline{
  display:flex;
  justify-content:flex-start;
  gap:4px;
  align-items:center;
  flex-wrap:nowrap;
}

/* ✅ Kleinere actie-iconen in tabellen (kolom Acties) */
.data-table td.actions .action-icon{
  font-size: 15px !important;   /* was 18px */
  padding: 5px !important;      /* was 7px */
  margin: 0 2px !important;     /* was 0 4px */
}

.data-table td.actions .action-icon i{
  font-size: 15px !important;
}

/* optioneel: iets subtieler hover */
.data-table td.actions .action-icon:hover{
  transform: scale(1.10);
}

/* 2 kolommen voor werkomschrijving */
.werk-2col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media(max-width: 1000px){
  .werk-2col{ grid-template-columns: 1fr; }
}
.werk-2col textarea{
  width:100%;
  min-height:120px;
}

.data-table.detail-layout{
  width: 100%;
}

.data-table.detail-layout th,
.data-table.detail-layout td{
  text-align: left !important;
  vertical-align: top;
}

/* 40 / 60 kolom verdeling */
.data-table.detail-layout th{
  width: 40%;
  white-space: nowrap;   /* labels blijven netjes */
}

.data-table.detail-layout td{
  width: 60%;
}

/* Mobiel: labels mogen wrappen */
@media (max-width: 700px){
  .data-table.detail-layout th{
    white-space: normal;
  }
}