/* AtSea CRM – UI polish layer (safe overrides)
   Accent: #0a84ff
   Components: pills, stepper, progress bars, toasts
*/

:root {
  --accent: #0a84ff;
  --accent-weak: rgba(10, 132, 255, 0.15);
  --radius: 12px;
  --shadow-soft: 0 10px 28px rgba(17, 24, 39, 0.08);
  --border-soft: rgba(17, 24, 39, 0.10);
  /* Unified content width across modules */
  --content-max: 1500px;
}

/* ------------------------------------------------------------
   Medewerkers – detailpagina (consistent met CRM signature)
   ------------------------------------------------------------ */

/* Content width + breathing room */
.page-wrap{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 18px 28px;
}

/* Wider content wrapper for heavy pages like Planning */
.page-wrap--wide{
  max-width: 1700px;
}

/* Make the default shell container match the same width */
.app-content{ max-width: var(--content-max); }

/* ------------------------------------------------------------
   Consistent buttons (works even if a view forgets the `.btn` class)
   ------------------------------------------------------------ */
.btn-outline,
.btn-ghost,
.btn-primary,
.btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  line-height:1;
  border-radius:12px;
  text-decoration:none;
  white-space:nowrap;
}

/* ------------------------------------------------------------
   Consistent badges / pills
   ------------------------------------------------------------ */
/* Ensure badges visually match pills across the CRM */
.badge{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.03);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* Legacy fallback: some pages use `badge-gray` */
.badge.badge-gray{
  background: rgba(148,163,184,.20);
  color:#111827;
  border-color: rgba(148,163,184,.25);
}
@media (min-width: 1800px){
  .page-wrap--wide{ max-width: 1800px; }
}

/* Header rhythm */
.page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding: 6px 0 14px;
}

.page-title{
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-subtitle{ margin-top: 6px; color:#6b7280; }

/* Tabs – active underline in accent */
.tabs-nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 10px 0 14px;
}

.tabs-nav-link{
  border-radius: 999px !important;
}

.tabs-nav-link.is-active{
  border-color: rgba(10,132,255,.35) !important;
  background: rgba(10,132,255,.10) !important;
  color: #0a84ff !important;
}

/* Card head spacing */
.card-head{
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(17,24,39,.06);
}

.card-title{
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Bootstrap-ish badges (used on medewerker detail) -> match pill style */
.badge.badge-pill{
  border-radius: 999px !important;
  padding: 6px 10px !important;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(17,24,39,.03);
  color: #111827;
}

.badge-success{ 
  border-color: rgba(22,163,74,.25) !important;
  background: rgba(22,163,74,.12) !important;
  color: #166534 !important;
}

.badge-muted{
  border-color: rgba(107,114,128,.25) !important;
  background: rgba(107,114,128,.10) !important;
  color: #374151 !important;
}

/* Form grid on detail pages */
.form-grid{
  display:grid !important;
  gap: 14px 18px !important;
}

.form-grid--3cols{
  grid-template-columns: repeat(1,minmax(0,1fr)) !important;
}

@media (min-width: 900px){
  .form-grid--3cols{ grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
}

/* Make label/value read nicely */
.form-grid .text-xs.text-muted{
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: rgba(107,114,128,.9);
  margin-bottom: 4px;
}

.form-grid p:not(.text-xs){
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* Global focus ring */
:where(a, button, input, select, textarea):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-weak);
  border-color: var(--accent);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-weak) !important;
}

/* Primary button uses accent */
.btn.btn-primary,
button.btn-primary,
a.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 10px 22px rgba(10, 132, 255, 0.18);
}

.card, .fin-box {
  border-radius: var(--radius) !important;
}

.card:hover {
  box-shadow: var(--shadow-soft);
}

/* Project tabs accent underline */
.project-topnav a.is-active {
  border-bottom-color: var(--accent) !important;
}

/* Pills */
.crm-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(17, 24, 39, 0.03);
  color: #111827;
  white-space: nowrap;
}

.crm-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.crm-pill.is-muted::before { background: #9ca3af; box-shadow: none; }
.crm-pill.is-success::before { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15); }
.crm-pill.is-warn::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.crm-pill.is-danger::before { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

/* Stepper */
.crm-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  background: rgba(17, 24, 39, 0.02);
  border-radius: var(--radius);
  margin: 10px 0 14px;
}

.crm-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

.crm-step .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.crm-step.is-done { color: #111827; }
.crm-step.is-done .dot { background: rgba(17, 24, 39, 0.35); }

.crm-step.is-active { color: #111827; }
.crm-step.is-active .dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-weak);
}

/* Progress */
.crm-progress { margin-top: 10px; }
.crm-progress .meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.crm-progress .bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  overflow: hidden;
}

.crm-progress .fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.crm-progress.is-warn .fill { background: #f59e0b; }
.crm-progress.is-danger .fill { background: #ef4444; }

/* Toasts */
.crm-toasts {
  position: fixed;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.crm-toast {
  min-width: 240px;
  max-width: 420px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.crm-toast .msg { font-weight: 700; color: #111827; }
.crm-toast .close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #6b7280;
}

.crm-toast.is-success { border-color: rgba(22, 163, 74, 0.25); }
.crm-toast.is-info { border-color: rgba(10, 132, 255, 0.25); }
.crm-toast.is-error { border-color: rgba(239, 68, 68, 0.25); }

/* Generic pills used in lists/tables */
.pill {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid var(--border-soft);
  background: rgba(17,24,39,.03);
  color:#111827;
  white-space:nowrap;
}

.pill--status::before,
.pill--prio::before {
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.pill--open::before { background:#9ca3af; box-shadow:none; }
.pill--progress::before { background: var(--accent); }
.pill--waiting::before { background:#f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.pill--done::before { background:#16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }

.pill--danger::before { background:#ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.pill--warning::before { background:#f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.pill--muted::before { background:#9ca3af; box-shadow:none; }

/* Filter pills – label colors (types/segments)
   Usage: <a class="pill pill--blue"> ... </a>
*/
.pill.pill--blue   { --pill: #0a84ff; }
.pill.pill--green  { --pill: #16a34a; }
.pill.pill--purple { --pill: #7c3aed; }
.pill.pill--teal   { --pill: #06b6d4; }
.pill.pill--amber  { --pill: #f59e0b; }
.pill.pill--red    { --pill: #ef4444; }
.pill.pill--gray   { --pill: #6b7280; }

/* Project type pills (tables) */
.pill.pill--type-websites { --pill: #0a84ff; }
.pill.pill--type-grafisch { --pill: #7c3aed; }
.pill.pill--type-hosting  { --pill: #06b6d4; }
.pill.pill--type-kleding  { --pill: #f59e0b; } /* amber/orange */
.pill.pill--type-overige  { --pill: #6b7280; }

/* Kleding status pills */
.pill.pill--status-showroom     { --pill: #f59e0b; }
.pill.pill--status-in_magazijn  { --pill: #16a34a; }
.pill.pill--status-magazijn     { --pill: #16a34a; }
.pill.pill--status-uitgeleend   { --pill: #0a84ff; }
.pill.pill--status-afgeschreven { --pill: #ef4444; }

.pill[class*="pill--"]{
  border-color: color-mix(in srgb, var(--pill) 25%, rgba(15,23,42,.10));
  background: color-mix(in srgb, var(--pill) 9%, #ffffff);
}

.pill[class*="pill--"] .pill-count{
  border-color: color-mix(in srgb, var(--pill) 22%, rgba(15,23,42,.10));
  background: color-mix(in srgb, var(--pill) 14%, rgba(15,23,42,.06));
  color: color-mix(in srgb, var(--pill) 55%, #0f172a);
}

.pill-active[class*="pill--"]{
  background: color-mix(in srgb, var(--pill) 12%, #f3f4f6);
  border-color: color-mix(in srgb, var(--pill) 28%, rgba(15,23,42,.18));
}

/* Tables: spacing + typography + hover */
.table-wrapper table,
.crm-table,
.card table {
  font-size: 13px;
}

.table-wrapper table th,
.table-wrapper table td,
.crm-table th,
.crm-table td,
.card table th,
.card table td {
  padding: 10px 12px;
  vertical-align: top;
}

.table-wrapper table thead th,
.crm-table thead th,
.card table thead th {
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(11,18,32,.65);
}

.table-wrapper table tbody tr:hover,
.crm-table tbody tr:hover,
.card table tbody tr:hover {
  background: rgba(10,132,255,.04);
}

/* Empty states */
.empty-state-cell { padding: 24px !important; }
.empty-state {
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:6px;
}
.empty-state-icon {
  width:44px;height:44px;
  border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(10,132,255,.10);
  color: var(--accent);
  font-weight:800;
  font-size:18px;
}
.empty-state-title { font-weight:800; color:#111827; }
.empty-state-text { font-size:13px; color: rgba(11,18,32,.65); }



/* Kanban board */
.crm-kanban__header-actions{display:flex;gap:8px;align-items:center;}
.crm-kanban__cardbody{padding-bottom:8px;}
.crm-kanban__tip{font-size:13px;margin-bottom:10px;}

.crm-kanban{
  display:flex;
  gap:16px;
  align-items:flex-start;
  overflow-x:auto;
  padding-bottom:6px;
}

.crm-kanban__col{
  flex:0 0 280px;
  max-width:280px;
  background: rgba(17, 24, 39, 0.02);
  border-radius: var(--radius);
  padding:10px;
  border:1px solid rgba(17, 24, 39, 0.08);
}

.crm-kanban__colhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}

.crm-kanban__coltitle{
  font-size:14px;
  font-weight:700;
  margin:0;
  letter-spacing:0.2px;
}

.crm-kanban__colbody{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:52px;
}

.crm-kanban__card{
  background:#fff;
  border-radius: 12px;
  padding:10px 10px 9px;
  border:1px solid rgba(17, 24, 39, 0.10);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor:grab;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.crm-kanban__card:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: rgba(10, 132, 255, 0.25);
}

.crm-kanban__card:active{ cursor:grabbing; }

.crm-kanban__title{
  display:block;
  font-size:13px;
  font-weight:700;
  margin-bottom:6px;
  color: inherit;
  text-decoration:none;
}

.crm-kanban__title:hover{ text-decoration: underline; }

.crm-kanban__meta{
  font-size:11px;
  line-height:1.35;
  margin-top:2px;
}

.crm-empty{
  font-size:11px;
  padding:8px 8px;
  color: rgba(17, 24, 39, 0.55);
  background: rgba(255,255,255,0.6);
  border: 1px dashed rgba(17, 24, 39, 0.16);
  border-radius: 10px;
}

/* === ACTIONS CENTER + DROPDOWN FALLBACK (v65) === */
th.col-actions,
td.col-actions,
td.actions,
th.actions,
td.actions-cell,
td.table-cell-actions,
th.actions-cell,
th.table-cell-actions {
  text-align: center !important;
}

td.actions,
td.col-actions,
td.actions-cell,
td.table-cell-actions {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Inline fallback menu styling (only used if JS portal can't open) */
.row-actions .row-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.18);
  padding: 6px;
  z-index: 9999;
}
.row-actions .row-menu[hidden] { display: none !important; }

/* =========================================================
   v14 – UX: breadcrumbs + inline validation
   ========================================================= */

.breadcrumbs{
  margin: 6px 0 10px;
}
.breadcrumbs ol{
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:0;
  margin:0;
  align-items:center;
}
.breadcrumbs-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color: rgba(15,23,42,0.70);
}
.breadcrumbs-link{
  color: rgba(15,23,42,0.72);
  text-decoration:none;
}
.breadcrumbs-link:hover{ text-decoration:underline; }
.breadcrumbs-current{
  color: rgba(15,23,42,0.88);
  font-weight:600;
}
.breadcrumbs-sep{ color: rgba(15,23,42,0.35); }

/* Inline validation (client-side) */
input.is-invalid, select.is-invalid, textarea.is-invalid{
  border-color: rgba(220,38,38,0.55) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important;
}
.field-error{
  margin-top:6px;
  font-size:12px;
  color:#b91c1c;
}


/* Basic form control (fallback) */
.form-control{width:100%;}







@media (max-width: 1100px){
  #contactpersoonForm.cp-form{ grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #contactpersoonForm.cp-form [style*="grid-column"]{ grid-column: 1 / -1 !important; }
}
@media (max-width: 700px){
  #contactpersoonForm.cp-form{ grid-template-columns: 1fr !important; }
}


/* ------------------------------------------------------------
   Global tables (lists everywhere)
   ------------------------------------------------------------ */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border:1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 1px 0 rgba(17,24,39,.03);
}
thead th{
  position:sticky;
  top:0;
  background: rgba(249,250,251,.92);
  backdrop-filter: blur(6px);
  text-align:left;
  font-weight:600;
  font-size:.85rem;
  color: rgba(17,24,39,.78);
  padding:10px 12px;
  border-bottom:1px solid var(--border-soft);
  z-index:1;
  white-space:nowrap;
}
tbody td{
  padding:10px 12px;
  border-bottom:1px solid rgba(17,24,39,.07);
  vertical-align:top;
  font-size:.92rem;
}
tbody tr:nth-child(even){ background: rgba(249,250,251,.5); }
tbody tr:hover{ background: rgba(10,132,255,.06); }
tbody tr:last-child td{ border-bottom:0; }

/* action columns (buttons/icons) */
td.actions, th.actions{ text-align:right; white-space:nowrap; }
td.actions .btn{ margin-left:6px; }

/* tables inside cards */
.card table{ border-radius: 10px; }

/* ------------------------------------------------------------
   Global forms (consistent inputs)
   ------------------------------------------------------------ */
form .form-row{ display:flex; gap:14px; flex-wrap:wrap; }
label{ display:block; font-weight:600; font-size:.9rem; margin: 0 0 6px; color: rgba(17,24,39,.85); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="url"], input[type="search"],
textarea, select{
  width:100%;
  max-width: 100%;
  padding:10px 12px;
  border:1px solid rgba(17,24,39,.14);
  border-radius: 12px;
  background:#fff;
  font-size: .95rem;
  line-height: 1.2;
  transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
textarea{ min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus{
  outline: none;
  border-color: rgba(10,132,255,.55);
  box-shadow: 0 0 0 4px rgba(10,132,255,.12);
}
.help-text{ font-size:.85rem; color: rgba(17,24,39,.65); margin-top:6px; }
.field-error{ font-size:.85rem; color:#b42318; margin-top:6px; }

/* Form sections */
.form-section{
  background:#fff;
  border:1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}
.form-section h2, .form-section h3{ margin: 0 0 10px; font-size: 1rem; }

/* ------------------------------------------------------------
   Loading states (buttons + forms)
   ------------------------------------------------------------ */
.btn.is-loading, button.is-loading{
  position: relative;
  pointer-events:none;
  opacity:.75;
}
.btn.is-loading::after, button.is-loading::after{
  content:'';
  width: 14px; height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(17,24,39,.25);
  border-top-color: rgba(17,24,39,.65);
  display:inline-block;
  margin-left: 10px;
  vertical-align: -2px;
  animation: crmspin .8s linear infinite;
}
@keyframes crmspin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------
   Dashboard widgets (more action-focused feel)
   ------------------------------------------------------------ */
.dashboard-widgets-grid{ gap: 14px; }
.card{ border-radius: var(--radius); }
.card-head h2{ font-size: 1rem; margin:0; }
.widget-actions .btn{ border-radius: 999px; }
