/* =====================================================================
   Van Zanten Consulting — Portal stylesheet
   Erfgenaam van index.html — zelfde tokens, zelfde atelier-esthetiek.
   ===================================================================== */

:root{
  --paper:    #F5F3EE;
  --paper-2:  #ECE9E1;
  --paper-3:  #FBFAF6;
  --ink:      #0E0F12;
  --ink-2:    #1B1D22;
  --dim:      #5C5F66;
  --mute:     #8E9099;
  --line:     rgba(14,15,18,0.10);
  --line-soft:rgba(14,15,18,0.06);
  --accent:   #C2410C;
  --accent-2: #1E3A8A;
  --grid:     rgba(14,15,18,0.06);
  --ok:       #1A7A4A;
  --warn:     #C17A00;
  --danger:   #B91C1C;
}

*{ -webkit-tap-highlight-color: transparent; }
html{ scroll-behavior: smooth; background: var(--paper); }
body{
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01","cv11";
}
::selection{ background: var(--ink); color: var(--paper); }

.serif{ font-family: 'Instrument Serif', 'Times New Roman', serif; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ital { font-style: italic; }

/* Fixed grid backdrop — subtieler dan op de homepage */
.page-grid{
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, #000 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, #000 40%, transparent 90%);
}
.page-grid-fine{
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
}
.grain{
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .22; mix-blend-mode: multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; gap:.55rem;
  padding: .85rem 1.2rem; border-radius: 999px;
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  transition: transform .25s ease, background .25s, color .25s, border-color .25s, box-shadow .25s;
  cursor: pointer;
}
.btn-ink{ background: var(--ink); color: var(--paper); }
.btn-ink:hover{ transform: translateY(-1px); box-shadow: 0 14px 30px -16px rgba(14,15,18,0.5); }
.btn-ghost{ border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover{ border-color: var(--ink); }
.btn-sm{ padding: .55rem .85rem; font-size: 12.5px; }
.btn:disabled{ opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .arrow{ transition: transform .25s; }
.btn:hover .arrow{ transform: translateX(3px); }

.hairline{ border-color: var(--line); }
.hairline-soft{ border-color: var(--line-soft); }
.rule{ height: 1px; background: var(--line); }

/* Reveal */
.rv{ opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in{ opacity: 1; transform: none; }
[data-d="1"]{ transition-delay: .06s; }
[data-d="2"]{ transition-delay: .12s; }
[data-d="3"]{ transition-delay: .18s; }
[data-d="4"]{ transition-delay: .24s; }
[data-d="5"]{ transition-delay: .30s; }
[data-d="6"]{ transition-delay: .36s; }

/* Plate / card */
.plate{
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.plate-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dim);
}
.plate-body{ padding: 1.25rem 1.1rem; }

/* Label-marker */
.label-mark{
  display:inline-flex; align-items:center; gap: .55rem; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); font-family: 'JetBrains Mono', monospace;
}
.label-mark .tick{ width: 18px; height: 1px; background: var(--ink); display:inline-block; }

/* Chip */
.chip{
  display:inline-flex; align-items:center; gap:.4rem; padding: .35rem .7rem;
  border-radius: 999px; border: 1px solid var(--line); font-size: 11.5px;
  color: var(--dim); background: rgba(255,255,255,0.5);
  font-family: 'JetBrains Mono', monospace; letter-spacing: .04em;
}
.chip-ink{ background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Status badges */
.badge{
  display:inline-flex; align-items:center; gap: .4rem;
  padding: .25rem .65rem; border-radius: 999px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line); background: rgba(255,255,255,0.55);
  color: var(--dim);
}
.badge::before{ content:""; display:inline-block; width:6px; height:6px; border-radius:999px; background: currentColor; opacity:.85; }
.badge-active   { color: var(--accent-2); }
.badge-review   { color: var(--warn); }
.badge-done     { color: var(--ok); }
.badge-support  { color: var(--ink-2); }
.badge-paid     { color: var(--ok); }
.badge-sent     { color: var(--accent-2); }
.badge-overdue  { color: var(--danger); }
.badge-draft    { color: var(--mute); }
.badge-pending  { color: var(--warn); }
.badge-changed  { color: var(--danger); }
.badge-approved { color: var(--ok); }
.badge-intake   { color: var(--mute); }
.badge-closed   { color: var(--mute); }

/* Pulse */
.pulse{ position:relative; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); display:inline-block; }
.pulse::after{ content:""; position:absolute; inset:-4px; border-radius:999px; border:1px solid var(--accent); animation: pulse 2s infinite; }
@keyframes pulse{ 0%{ transform: scale(.6); opacity:.9;} 100%{ transform: scale(1.7); opacity: 0;} }

/* Form fields — onderlijn-stijl (zoals contact form) */
.field{
  width: 100%; padding: .85rem 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; font-size: 16px;
  transition: border-color .25s;
}
.field:focus{ outline: none; border-color: var(--ink); }
.field::placeholder{ color: var(--mute); }

/* Filled field — voor admin formulieren */
.field-box{
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper-3); color: var(--ink); font: inherit; font-size: 14.5px;
  transition: border-color .2s, background .2s;
}
.field-box:focus{ outline: none; border-color: var(--ink); background: #fff; }
.field-box::placeholder{ color: var(--mute); }
textarea.field-box{ resize: vertical; min-height: 80px; line-height: 1.5; }
select.field-box{ appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* Underline marker */
.underline-ink{ background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 2px; }

/* Portal navigation */
.portal-nav{
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px);
  background: rgba(245,243,238,0.78); border-bottom: 1px solid var(--line-soft);
}
.portal-nav-inner{
  max-width: 1320px; margin: 0 auto; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
@media (min-width: 768px){ .portal-nav-inner{ padding: 1rem 2rem; } }

.portal-tabs{
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  font-size: 13.5px;
}
.portal-tab{
  position: relative; color: var(--ink); padding: .35rem 0;
  transition: color .2s;
}
.portal-tab[data-num]::after{
  content: attr(data-num); position: absolute; top: -8px; right: -10px;
  font-size: 9px; font-family: 'JetBrains Mono', monospace; color: var(--mute);
}
.portal-tab.is-active{ color: var(--accent); }
.portal-tab.is-active::before{
  content: ""; position: absolute; bottom: -6px; left: 0; right: 0; height: 1px;
  background: var(--accent);
}
.portal-tab .badge-count{
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--paper);
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  margin-left: .35rem; vertical-align: middle;
}

/* Top meta strip */
.meta-strip{
  position: relative; z-index: 10; border-bottom: 1px solid var(--line-soft);
}
.meta-strip-inner{
  max-width: 1320px; margin: 0 auto; padding: .5rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--dim); text-transform: uppercase; letter-spacing: .14em;
}
@media (min-width: 768px){ .meta-strip-inner{ padding: .5rem 2rem; } }

/* Content shell */
.shell{ max-width: 1320px; margin: 0 auto; padding: 2rem 1.25rem; position: relative; z-index: 10; }
@media (min-width: 768px){ .shell{ padding: 3rem 2rem; } }

/* Section header */
.section-head{ display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.section-head .num{ grid-column: span 12; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: .18em; color: var(--dim); }
@media (min-width: 768px){ .section-head .num{ grid-column: span 3; } }
.section-head h1{ grid-column: span 12; font-family: 'Instrument Serif', serif;
  font-size: 44px; line-height: 1.02; letter-spacing: -0.02em; }
@media (min-width: 768px){
  .section-head h1{ grid-column: span 9; font-size: 64px; }
}
.section-head .sub{ grid-column: span 12; color: var(--dim); font-size: 15px; max-width: 60ch; }
@media (min-width: 768px){ .section-head .sub{ grid-column: 4 / span 9; margin-top: 1rem; } }

/* Action card (urgent) */
.action-card{
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border: 1px solid var(--accent); border-radius: 4px;
  background: rgba(194,65,12,0.04);
}
.action-card .left{ display: flex; align-items: center; gap: .85rem; }
.action-card .icon{ width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 999px; background: var(--accent); color: var(--paper); flex-shrink: 0; }

/* Table-ish lists */
.list-row{
  display: grid; grid-template-columns: 1fr; gap: .25rem;
  padding: 1rem 1.1rem; border-bottom: 1px solid var(--line-soft);
  transition: background .2s;
}
.list-row:hover{ background: rgba(14,15,18,0.025); }
.list-row .row-title{ font-size: 15px; }
.list-row .row-meta{ font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--mute); text-transform: uppercase; letter-spacing: .14em; }

@media (min-width: 768px){
  .list-row{
    grid-template-columns: minmax(140px,1.2fr) minmax(0,2fr) minmax(120px,1fr) auto;
    align-items: center; gap: 1rem;
  }
}

/* Progress bar */
.progress{ height: 4px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.progress > span{ display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width 1s cubic-bezier(.2,.7,.2,1); }

/* Timeline (milestones) */
.timeline{ display: flex; gap: .75rem; overflow-x: auto; padding: .25rem 0 .75rem; }
.timeline::-webkit-scrollbar{ height: 4px; }
.timeline::-webkit-scrollbar-thumb{ background: rgba(14,15,18,0.15); border-radius: 99px; }
.tl-item{
  flex: 0 0 auto; min-width: 160px; padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper-3);
  display: flex; flex-direction: column; gap: .35rem;
}
.tl-item.done{ background: rgba(26,122,74,0.06); border-color: rgba(26,122,74,0.25); }
.tl-item.next{ border-color: var(--ink); }
.tl-item .marker{ font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--dim); text-transform: uppercase; letter-spacing: .14em; }
.tl-item .ms-title{ font-size: 14px; line-height: 1.3; }
.tl-item .date{ font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--mute); }

/* Update card */
.update-card{
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper-3); padding: 1.25rem 1.25rem;
}
.update-card.pinned{ border-color: var(--ink); }
.update-card .when{ font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--mute); text-transform: uppercase; letter-spacing: .14em; }
.update-card .author{ font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink); text-transform: uppercase; letter-spacing: .14em; }
.update-card .body{ margin-top: .75rem; line-height: 1.55; font-size: 15px; }
.update-card .body p{ margin: 0 0 .65rem; }
.update-card .body strong{ font-weight: 600; }
.update-card .body code{ font-family: 'JetBrains Mono', monospace; font-size: 13px;
  background: rgba(14,15,18,0.06); padding: .1rem .35rem; border-radius: 3px; }
.update-card .body ul{ list-style: disc; padding-left: 1.25rem; margin: .25rem 0 .65rem; }
.update-card .body a{ color: var(--accent); }

/* Loom embed */
.loom-embed{ position: relative; padding-bottom: 56.25%; height: 0; margin-top: 1rem; border-radius: 4px; overflow: hidden; }
.loom-embed iframe{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Messages */
.msg-list{ display: flex; flex-direction: column; gap: .85rem; padding: 1.25rem;
  background: var(--paper-3); border: 1px solid var(--line); border-radius: 4px;
  max-height: 60vh; overflow-y: auto;
}
.msg-list::-webkit-scrollbar{ width: 6px; }
.msg-list::-webkit-scrollbar-thumb{ background: rgba(14,15,18,0.15); border-radius: 99px; }
.msg-row{ display: flex; gap: .75rem; }
.msg-row.me{ justify-content: flex-end; }
.msg-bubble{
  max-width: 78%; padding: .75rem 1rem; border-radius: 4px;
  font-size: 14.5px; line-height: 1.5;
  border: 1px solid var(--line-soft); background: rgba(14,15,18,0.025);
  white-space: pre-wrap; word-break: break-word;
}
.msg-row.me .msg-bubble{ background: var(--ink); color: var(--paper); border-color: var(--ink); }
.msg-meta{ font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--mute); text-transform: uppercase; letter-spacing: .14em; margin-top: .25rem; }

/* File row */
.file-row{
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line-soft); transition: background .2s;
}
.file-row:hover{ background: rgba(14,15,18,0.025); }
.file-row .ico{ width: 28px; height: 28px; display: grid; place-items: center; font-size: 14px; }
.file-row .meta{ font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--mute); text-transform: uppercase; letter-spacing: .12em; }

/* Empty state */
.empty{
  border: 1px dashed var(--line); border-radius: 4px;
  padding: 3rem 1.5rem; text-align: center; color: var(--dim);
  font-size: 14.5px; background: rgba(255,255,255,0.4);
}
.empty .empty-title{ font-family: 'Instrument Serif', serif; font-style: italic; font-size: 22px;
  color: var(--ink); margin-bottom: .35rem; }

/* Skeleton */
.skel{ background: linear-gradient(90deg, var(--paper-2) 25%, rgba(236,233,225,0.5) 50%, var(--paper-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; }
@keyframes shimmer{ from{ background-position: 200% 0; } to{ background-position: -200% 0; } }

/* Toast */
.toast{
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  padding: .75rem 1.25rem; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 13.5px; z-index: 100; box-shadow: 0 14px 30px -16px rgba(14,15,18,0.5);
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error{ background: var(--danger); }
.toast.ok{ background: var(--ink); }

/* Auth pages — gecentreerd */
.auth-shell{
  min-height: calc(100vh - 60px);
  display: grid; place-items: center; padding: 2rem 1.25rem;
  position: relative; z-index: 10;
}
.auth-card{
  width: 100%; max-width: 460px;
  background: var(--paper-3); border: 1px solid var(--line); border-radius: 4px;
  padding: 2.5rem 2rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
  .rv{ opacity: 1 !important; transform: none !important; }
}

/* Hide on mobile, show on md+ */
.md-only{ display: none; }
@media (min-width: 768px){ .md-only{ display: initial; } .mobile-only{ display: none; } }
