/* =========================================================
   RO Opdrachtenmonitor - Visuele stijl
   ========================================================= */

:root {
  --sidebar-w: 272px;
  --ink: #0f172a;
  --brand-1: #4f46e5;
  --brand-2: #0ea5e9;
  --brand-3: #10b981;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(99,102,241,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(14,165,233,.07), transparent 60%),
    #f4f6fb;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(400px 300px at 0% 0%, rgba(99,102,241,.35), transparent 70%),
    radial-gradient(300px 300px at 100% 100%, rgba(14,165,233,.25), transparent 70%),
    linear-gradient(180deg, #0b1023 0%, #151a3a 55%, #1b1748 100%);
  transition: transform .3s ease;
}
.main-area { margin-left: var(--sidebar-w); }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
}

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: .75rem;
  width: 100%;
  padding: .7rem .9rem;
  border-radius: .85rem;
  color: #a5b4fc;
  color: rgba(226,232,240,.72);
  font-size: .85rem; font-weight: 500;
  transition: all .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.nav-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(14,165,233,.85));
  box-shadow: 0 10px 25px -10px rgba(79,70,229,.8), inset 0 1px 0 rgba(255,255,255,.2);
}
.nav-item .nav-badge {
  margin-left: auto;
  font-size: .68rem; font-weight: 700;
  padding: .1rem .5rem; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #e2e8f0;
}
.nav-item.nav-active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }
.nav-badge.warn { background: rgba(251,146,60,.25); color: #fed7aa; }

.q-pill {
  padding: .45rem 0; border-radius: .65rem;
  font-size: .75rem; font-weight: 700;
  color: rgba(226,232,240,.7);
  background: rgba(255,255,255,.05);
  transition: all .2s ease;
}
.q-pill:hover { background: rgba(255,255,255,.12); color: #fff; }
.q-pill.active { background: #fff; color: #312e81; box-shadow: 0 6px 16px -6px rgba(0,0,0,.5); }

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(244,246,251,.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #312e81 0%, #4f46e5 38%, #0284c7 75%, #0d9488 100%);
  background-size: 200% 200%;
  animation: heroShift 18s ease infinite;
}
@keyframes heroShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.hero .blob {
  position: absolute; border-radius: 50%;
  filter: blur(50px); opacity: .45;
  animation: floaty 12s ease-in-out infinite;
}
.hero .blob.b1 { width: 320px; height: 320px; background: #a78bfa; top: -120px; right: 18%; }
.hero .blob.b2 { width: 260px; height: 260px; background: #22d3ee; bottom: -140px; right: -40px; animation-delay: -4s; }
.hero .blob.b3 { width: 200px; height: 200px; background: #f472b6; top: 40%; left: 40%; opacity: .25; animation-delay: -8s; }
@keyframes floaty {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(20px,-25px) scale(1.08); }
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 70%);
}
.glass-chip {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px);
}

/* Gezondheidsring */
.ring-track { stroke: rgba(255,255,255,.18); }
.ring-value {
  stroke: url(#ringGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1);
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.08);
}

.kpi-card {
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -18px rgba(15,23,42,.25); }
.kpi-card::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--kpi-glow, rgba(99,102,241,.12));
  transition: transform .4s ease;
}
.kpi-card:hover::after { transform: scale(1.4); }
.kpi-card.kpi-active { border-color: var(--kpi-color, #6366f1); box-shadow: 0 0 0 3px var(--kpi-glow, rgba(99,102,241,.2)), 0 20px 40px -18px rgba(15,23,42,.25); }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 20px -8px var(--kpi-color, #6366f1);
}
.kpi-bar { height: 6px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.kpi-bar > span { display: block; height: 100%; border-radius: 999px; width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }

/* ---------- Form controls ---------- */
.select-pill {
  appearance: none;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center;
  border: 1px solid #e2e8f0;
  border-radius: .8rem;
  padding: .55rem 2rem .55rem .85rem;
  font-size: .78rem; font-weight: 500; color: #334155;
  cursor: pointer;
  transition: all .15s ease;
}
.select-pill:hover { border-color: #c7d2fe; background-color: #fff; }
.select-pill:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); background-color: #fff; }
.select-pill.has-value { border-color: #a5b4fc; background-color: #eef2ff; color: #3730a3; font-weight: 600; }

.input-field {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .8rem;
  padding: .6rem .85rem;
  font-size: .8rem; color: #0f172a;
  transition: all .15s ease;
}
.input-field:focus { outline: none; background: #fff; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.field-label { display: block; font-size: .72rem; font-weight: 600; color: #475569; margin-bottom: .35rem; }

.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.1rem; border-radius: .85rem;
  font-size: .8rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  box-shadow: 0 10px 20px -10px rgba(79,70,229,.9);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 14px 26px -10px rgba(79,70,229,.9); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: .85rem;
  font-size: .8rem; font-weight: 600; color: #334155;
  background: #fff; border: 1px solid #e2e8f0;
  transition: all .15s ease;
}
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }

/* ---------- Tabel ---------- */
.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafc;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #64748b;
  padding: .85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.data-table thead th[data-sort] { cursor: pointer; user-select: none; }
.data-table thead th[data-sort]:hover { color: #4f46e5; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: linear-gradient(90deg, rgba(238,242,255,.8), rgba(240,249,255,.5)); }
.data-table tbody td { padding: .8rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table thead th { padding-left: .75rem !important; padding-right: .75rem !important; }
.row-actions { opacity: 0; transition: opacity .15s ease; }
.data-table tbody tr:hover .row-actions { opacity: 1; }

/* ---------- Avatars ---------- */
.avatar {
  width: 30px; height: 30px; border-radius: 999px;
  display: inline-grid; place-items: center;
  font-size: .65rem; font-weight: 700; color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.15);
  flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: .58rem; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

/* ---------- Kanban ---------- */
.kanban-col {
  background: rgba(241,245,249,.7);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 1.25rem;
  backdrop-filter: blur(4px);
}
.kanban-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--prio-color, #cbd5e1);
  border-radius: 1rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(15,23,42,.3); }
.sortable-ghost { opacity: .35; }
.sortable-chosen { transform: rotate(1.5deg); }
.kanban-drop-hint { border: 2px dashed #c7d2fe; border-radius: 1rem; }

/* ---------- Animaties ---------- */
.fade-up { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }

.pulse-dot { position: relative; }
.pulse-dot::before {
  content: ''; position: absolute; inset: -4px; border-radius: 999px;
  background: currentColor; opacity: .35;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- Modals ---------- */
.modal-backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(6px); }
.modal-panel { animation: modalIn .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
#toast { transition: all .3s cubic-bezier(.2,.8,.2,1); }

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden; }
  #detail-modal, #detail-modal * { visibility: visible; }
  #detail-modal { position: absolute; inset: 0; background: #fff; }
  .no-print { display: none !important; }
}
