/* StalKompas responsive beheeromgeving
   Desktop blijft ongewijzigd; tablet en telefoon krijgen een eigen, touch-vriendelijke layout. */

html,body{max-width:100%;overflow-x:hidden}
button,a,input,select,textarea{touch-action:manipulation}
.mobile-nav-backdrop{display:none}

/* Fluid content on laptops */
@media (max-width:1280px) and (min-width:901px){
  .page{padding:34px 30px 54px}
  .topbar{padding-inline:30px}
  .stats{gap:12px}
  .stat-card{padding:14px}
  .content-grid{grid-template-columns:minmax(0,1.35fr) minmax(330px,.9fr);gap:16px}
  .panel-head{padding:20px 21px 13px}
  .timeline,.attention-list,.task-list{padding-left:21px;padding-right:21px}
  .person-grid,.horse-grid,.location-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Tablet */
@media (max-width:900px){
  .shell{display:block;min-height:100dvh}
  main{width:100%!important;margin-left:0!important;min-width:0}
  .sidebar{
    z-index:100;width:min(310px,86vw)!important;height:100dvh;padding:18px 13px;
    transform:translateX(-105%)!important;transition:transform .22s ease,box-shadow .22s ease;
    overflow-y:auto;overscroll-behavior:contain;
  }
  .sidebar.open{transform:translateX(0)!important;box-shadow:16px 0 45px rgba(0,0,0,.24)!important}
  .sidebar.is-collapsed{width:min(310px,86vw)!important;padding:18px 13px}
  .sidebar.is-collapsed .brand,.sidebar.is-collapsed .nav-item{justify-content:flex-start;padding-left:13px;padding-right:13px}
  .sidebar.is-collapsed .brand-logo{width:188px!important;min-width:188px!important;max-width:188px!important}
  .sidebar.is-collapsed .nav-item{gap:13px}
  .sidebar.is-collapsed .nav-item>span:not(:first-child),.sidebar.is-collapsed .nav-label,.sidebar.is-collapsed nav{display:initial}
  .sidebar.is-collapsed .nav-label{display:block}
  .sidebar.is-collapsed nav{display:block}
  .sidebar-toggle{display:none!important}
  .mobile-nav-backdrop{position:fixed;inset:0;z-index:90;background:rgba(3,11,19,.52);backdrop-filter:none;-webkit-backdrop-filter:none}
  .mobile-nav-backdrop.visible{display:block}

  .topbar{
    height:64px;padding:0 18px!important;gap:10px;z-index:80;
    padding-top:env(safe-area-inset-top)!important;
  }
  .menu-button{display:grid!important;place-items:center;width:40px;height:40px;flex:0 0 40px;border:1px solid var(--line)!important;border-radius:10px!important;background:var(--paper)!important;color:var(--ink);font-size:0!important;position:relative}
  .menu-button::before{content:"☰";font-size:20px;line-height:1}
  .date-control{min-width:0;gap:7px;font-size:12px;white-space:nowrap;overflow:hidden}
  .date-control span{overflow:hidden;text-overflow:ellipsis;max-width:34vw}
  .top-actions{margin-left:auto;gap:6px}
  .top-actions .icon-button{display:none!important}
  .top-actions .theme-toggle,.top-actions .notification-button,.top-actions .user-menu .icon-button{display:grid!important;place-items:center;width:38px;height:38px;flex:0 0 38px}
  .user-menu-popover{position:fixed!important;right:14px!important;top:58px!important;left:auto!important;max-width:calc(100vw - 28px)}

  .page{padding:28px 18px 46px!important;max-width:none}
  .page-heading{margin-bottom:22px;gap:16px;align-items:center}
  .page-heading>div{min-width:0}
  .page h1{font-size:27px}
  .page-heading>.primary{flex:0 0 auto}
  .hero-card{min-height:136px;padding:24px 26px}
  .hero-card:after{right:-85px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
  .stat-card{min-width:0;padding:14px}
  .stat-card>span:nth-child(2){min-width:0}
  .stat-card small{white-space:normal}
  .content-grid{grid-template-columns:1fr!important;gap:14px}
  .tasks-panel{margin-top:14px}
  .panel-head{padding:20px 20px 13px;gap:12px}
  .timeline,.attention-list,.task-list{padding-left:20px;padding-right:20px}

  .person-grid,.horse-grid,.location-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:13px}
  .entity-toolbar{flex-wrap:wrap;gap:8px}
  .search-field{flex:1 1 220px;min-width:180px}
  .directory-layout{grid-template-columns:1fr!important}
  .employee-directory,.customer-directory,.horse-directory,.location-directory{min-width:0}
  .employee-detail{min-width:0}
  .organization-page-grid{width:100%!important;max-width:700px}

  /* Planning: keep information readable instead of shrinking seven days */
  .schedule-board{padding:16px!important;overflow:hidden}
  .week-head{justify-content:flex-start!important;gap:8px!important;flex-wrap:wrap!important}
  .week-head>*{max-width:100%}
  .schedule-grid{max-width:100%;overflow-x:auto!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .schedule-grid:not(.planning-day-view){grid-template-columns:70px repeat(7,minmax(145px,1fr))!important}
  .planning-day-view{min-width:560px}
  .planning-axis-head,.planning-day-head{top:64px!important}

  .filter-row{overflow-x:auto;padding:14px 16px;white-space:nowrap;-webkit-overflow-scrolling:touch}
  .filter{flex:0 0 auto}
  .permission-table{overflow-x:auto!important}
  .permission-table-head,.permission-row{min-width:520px}
  .account-list-item,.account-edit-status{max-width:100%}
  .backup-actions{flex-wrap:wrap}

  dialog{max-height:calc(100dvh - 28px);overflow:auto;margin:auto}
  dialog form{padding:26px}
}

/* Phone */
@media (max-width:600px){
  .topbar{height:60px;padding:0 10px!important;gap:6px}
  .menu-button{width:38px;height:38px;flex-basis:38px}
  .date-control{font-size:11px;gap:4px;flex:1 1 auto;justify-content:flex-start}
  .date-control span{max-width:26vw}
  .top-actions{gap:4px}
  .top-actions .notification-button{display:none!important}
  .top-actions .theme-toggle,.top-actions .user-menu .icon-button{width:38px;height:38px;flex-basis:38px}
  .user-menu-popover{top:55px!important;right:8px!important}

  .page{padding:20px 12px 34px!important}
  .page-heading{align-items:flex-start!important;flex-wrap:wrap;margin-bottom:17px;gap:11px}
  .page-heading>div{flex:1 1 100%}
  .page-heading>.primary{width:100%;min-height:44px}
  .page h1{font-size:24px!important;line-height:1.12;letter-spacing:-.6px}
  .subtle{font-size:12.5px}

  .hero-card{min-height:162px!important;padding:20px!important;align-items:flex-start}
  .hero-card h2{font-size:19px!important;max-width:78%}
  .hero-card p:not(.eyebrow){font-size:12.5px;max-width:76%}
  .weather{position:absolute!important;right:16px!important;bottom:15px!important;margin:0!important;gap:7px}
  .weather>span{font-size:26px}.weather strong{font-size:20px}.weather small{font-size:10px}

  .stats{grid-template-columns:1fr 1fr!important;gap:8px!important;margin:12px 0}
  .stat-card{padding:10px!important;gap:8px;min-height:70px}
  .stat-icon{width:30px!important;height:30px!important;flex:0 0 30px}
  .stat-card strong{font-size:16px}
  .stat-card small{font-size:10.5px;line-height:1.2}
  .stat-card>span:last-child{display:none}

  .content-grid{gap:10px!important}
  .panel,.person-card,.horse-card,.location-card{border-radius:12px}
  .panel-head{padding:16px 14px 10px!important;gap:8px;align-items:flex-start}
  .panel-head h2{font-size:15px}
  .panel-head p{font-size:11px}
  .panel-head a{font-size:11px;white-space:nowrap}
  .attention-pagination{gap:4px!important;white-space:nowrap}
  .attention-pagination button{width:28px!important;height:28px!important}
  .timeline,.attention-list,.task-list{padding-left:14px!important;padding-right:14px!important}
  .timeline-row{grid-template-columns:40px minmax(0,1fr);gap:7px}
  .timeline-time{font-size:10px}
  .timeline-event{padding-left:13px}
  .event-card{padding:9px}
  .attention-list article{gap:8px;padding:12px 0;align-items:flex-start}
  .attention-list article>div:not(.attention-icon){min-width:0}
  .attention-list strong,.attention-list p{overflow-wrap:anywhere}
  .link-button{font-size:11px;padding:5px 0;flex:0 0 auto}
  .task-row{grid-template-columns:22px minmax(0,1fr) auto!important;gap:8px;padding:11px 0}
  .task-row .assignee{display:none!important}
  .task-title strong{font-size:12px}.task-title small{font-size:10px}
  .pill{font-size:9px;padding:3px 5px}

  .person-grid,.horse-grid,.location-grid{grid-template-columns:1fr!important;gap:10px}
  .person-card,.horse-card,.location-card{padding:15px}
  .entity-toolbar{margin:-3px 0 14px;gap:6px}
  .entity-toolbar .filter{font-size:11px;padding:7px 9px}
  .search-field{flex-basis:100%!important;width:100%;margin:2px 0 0!important}
  .search-field input{width:100%!important}
  .lesson-row{align-items:flex-start!important;flex-wrap:wrap;padding:13px!important;gap:8px!important}
  .lesson-time{width:auto;min-width:42px}
  .lesson-row>span:last-child{display:none!important}

  .schedule-board{padding:8px!important;margin-inline:-2px}
  .week-head{margin-bottom:10px!important}
  .week-head .soft-button,.week-head button{font-size:11px;padding:7px 9px}
  .planning-legend{font-size:9px!important;justify-content:flex-start!important}
  .schedule-grid:not(.planning-day-view){grid-template-columns:58px repeat(7,132px)!important}
  .planning-day-view{min-width:480px}
  .planning-time-axis,.planning-day-column{min-height:calc(var(--planning-grid-height,1024px) + 40px)}
  .planning-axis-head,.planning-day-head{top:60px!important;height:40px}

  .form-grid,.profile-name-grid,.customer-name-grid,.organization-hours{grid-template-columns:1fr!important;gap:0!important}
  dialog{width:calc(100% - 16px)!important;max-width:none!important;max-height:calc(100dvh - 16px);border-radius:14px}
  dialog form{padding:22px 17px!important}
  form h2{font-size:19px;margin-bottom:18px}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px;min-height:44px} /* prevents iOS zoom without stretching checkboxes */
  .employee-form-actions,.confirmation-actions{gap:8px;flex-wrap:wrap}
  .employee-form-actions>*{flex:1 1 140px}
  .backup-actions{display:grid!important;grid-template-columns:1fr;gap:8px}
  .backup-actions button{width:100%}
  .permission-section{padding:14px!important}
  .permission-table-head,.permission-row{min-width:460px}
  .account-list{overflow-wrap:anywhere}
  .my-day-heading{align-items:flex-start!important;gap:12px;flex-wrap:wrap}
  .my-day-date-control{width:100%;display:grid!important;grid-template-columns:auto 1fr auto;gap:6px}
  .my-day-date-control input{min-width:0}
}

/* Very small phones */
@media (max-width:390px){
  .date-control span{display:none}
  .stats{grid-template-columns:1fr!important}
  .stat-card{min-height:58px}
  .hero-card h2,.hero-card p:not(.eyebrow){max-width:100%}
  .hero-card{padding-bottom:64px!important}
  .attention-pagination span{font-size:10px}
}

/* Touch comfort */
@media (hover:none) and (pointer:coarse){
  .nav-item{min-height:46px}
  .primary,.soft-button,.filter,.link-button,.icon-button{min-height:40px}
  .nav-item:hover,.stat-card:hover,.primary:hover{transform:none}
}

/* Login also fits smaller devices */
@media (max-width:600px){
  .auth-screen{padding:12px!important;align-items:center}
  .auth-card{width:100%!important;max-width:430px;padding:24px 20px!important;border-radius:16px!important}
  .auth-brand{margin-bottom:22px!important}
  .auth-card h1{font-size:23px!important;line-height:1.15}
  .auth-options{align-items:flex-start;gap:10px;flex-wrap:wrap}
}


/* v3 — beheer topbar altijd vast + mobiele sidebar sluiten */
.mobile-sidebar-close{display:none}

/* Deze stylesheet wordt als laatste geladen; daarom staat de definitieve topbar-regel hier. */
main{padding-top:70px !important}
.topbar{
  position:fixed !important;
  top:0 !important;
  left:254px !important;
  right:0 !important;
  width:auto !important;
  height:70px;
  z-index:120 !important;
  transform:none !important;
  margin:0 !important;
  box-shadow:0 7px 24px rgba(15,31,48,.08);
}

@media (max-width:900px){
  main{padding-top:calc(64px + env(safe-area-inset-top)) !important}
  .topbar{
    left:0 !important;
    right:0 !important;
    width:100% !important;
    height:64px;
    z-index:120 !important;
  }
  .sidebar{z-index:150 !important;padding-top:64px !important}
  .mobile-nav-backdrop{z-index:140 !important}
  .mobile-sidebar-close{
    display:grid;
    place-items:center;
    position:absolute;
    top:12px;
    right:12px;
    width:40px;
    height:40px;
    border:1px solid var(--line);
    border-radius:10px;
    background:var(--paper);
    color:var(--ink);
    font-size:27px;
    line-height:1;
    cursor:pointer;
    z-index:2;
  }
  .sidebar .brand{padding-top:0}
}

@media (max-width:560px){
  main{padding-top:calc(60px + env(safe-area-inset-top)) !important}
  .topbar{height:60px}
  .sidebar{padding-top:60px !important}
  .mobile-sidebar-close{top:10px;right:10px;width:38px;height:38px}
}


/* v4 — herwerkte beheer-navigatie met inklapbare categorieën */
.nav-group{margin:0 0 12px}
.nav-group-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px 7px;border:0;background:transparent;color:#8f9aa1;cursor:pointer;text-transform:uppercase;letter-spacing:1.1px;font-size:10px;font-weight:800}
.nav-group-title{pointer-events:none}
.nav-group-chevron{font-size:14px;line-height:1;transition:transform .18s ease;color:#98a5ad}
.nav-group.is-open .nav-group-chevron{transform:rotate(180deg)}
.nav-group-panel{display:none;padding-top:3px}
.nav-group.is-open .nav-group-panel{display:block}
.nav-group-panel .nav-item{margin:3px 0}
.placeholder-page{padding:0}
.placeholder-page-inner{padding:34px 32px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}
.placeholder-page h2{margin:0;font-size:22px;letter-spacing:-.4px}
.placeholder-page p{margin:0;max-width:760px;color:var(--muted);font-size:15px}
.placeholder-tag{display:inline-flex;align-items:center;min-height:28px;padding:4px 10px;border-radius:999px;background:#e9f0ee;color:#165d50;font-size:11px;font-weight:750;letter-spacing:.05em;text-transform:uppercase}
@media (min-width:901px){
  .sidebar.is-collapsed .nav-group{margin-bottom:8px}
  .sidebar.is-collapsed .nav-group-toggle{justify-content:center;padding-inline:6px}
  .sidebar.is-collapsed .nav-group-title,.sidebar.is-collapsed .nav-group-chevron{display:none}
  .sidebar.is-collapsed .nav-group-panel{display:block!important}
}
@media (max-width:900px){
  .nav-group{margin-bottom:10px}
  .nav-group-toggle{padding-inline:13px;font-size:10px}
  .placeholder-page-inner{padding:26px 22px}
}
@media (max-width:560px){
  .placeholder-page-inner{padding:22px 18px}
  .placeholder-page h2{font-size:20px}
  .placeholder-page p{font-size:14px}
}


/* v5 — scrollbare sidebar en uniforme navigatie-iconen */
.sidebar{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  overscroll-behavior-y:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(116,128,135,.34) transparent;
}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-track{background:transparent}
.sidebar::-webkit-scrollbar-thumb{background:rgba(116,128,135,.28);border-radius:999px}
.sidebar::-webkit-scrollbar-thumb:hover{background:rgba(116,128,135,.46)}
.side-bottom{
  position:sticky;
  bottom:0;
  z-index:5;
  margin-top:20px;
  padding:10px 0 max(4px,env(safe-area-inset-bottom));
  background:linear-gradient(to bottom,rgba(251,252,251,0),#fbfcfb 26%);
}
:root[data-theme="dark"] .side-bottom{background:linear-gradient(to bottom,rgba(10,22,34,0),var(--paper) 26%)}
.nav-group-panel .nav-item>span:first-child{
  flex:0 0 20px !important;
  width:20px !important;
  height:20px;
  display:inline-grid;
  place-items:center;
  margin:0;
  padding:0;
  font-size:16px !important;
  line-height:1 !important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI Symbol","Segoe UI",sans-serif;
  font-variant-emoji:text;
  color:#7b8991;
}
.nav-group-panel .nav-item{align-items:center;gap:12px}
.nav-group-panel .nav-item.active>span:first-child{color:#2469ae}
@media (max-width:900px){
  .sidebar{overflow-y:auto !important;-webkit-overflow-scrolling:touch}
  .side-bottom{background:linear-gradient(to bottom,rgba(251,252,251,0),#fbfcfb 26%)}
  :root[data-theme="dark"] .side-bottom{background:linear-gradient(to bottom,rgba(10,22,34,0),var(--paper) 26%)}
}


/* v5 — zelfde hamburgerknop op desktop, tablet en smartphone */
@media (max-width:900px){
  .sidebar{overflow:hidden!important;padding-top:16px!important}
  .sidebar-header{padding:2px 0 12px!important;margin-bottom:2px}
  .sidebar-header .brand{padding-left:0!important;padding-right:0!important;justify-content:flex-start!important}
  .sidebar-toggle{display:grid!important;width:40px;height:40px;flex:0 0 40px;margin:0!important}
  .menu-button{display:grid!important;place-items:center;width:40px;height:40px;flex:0 0 40px;border:1px solid var(--line)!important;border-radius:10px!important;background:var(--paper)!important;color:var(--ink);font-size:0!important;position:relative}
  .menu-button::before{content:none!important}
  .menu-button svg,.sidebar-toggle svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .menu-button svg.is-right,.sidebar-toggle svg.is-right{transform:scaleX(-1)}
  .sidebar-scroll{overflow-y:auto!important;overscroll-behavior:contain;padding-bottom:22px}
}
@media (max-width:600px){
  .menu-button,.sidebar-toggle{width:38px;height:38px;flex-basis:38px}
}


/* V11 — iOS mobiele menu-overlay sluit altijd volledig mee */
@media (max-width:900px){
  .mobile-nav-backdrop{
    display:block!important;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    transition:opacity .16s ease,visibility 0s linear .16s;
  }
  .mobile-nav-backdrop.visible{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transition:opacity .16s ease;
  }
}


/* v13 — instellingen + compacte sidebar exact uitgelijnd */
.settings-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px;align-items:start}
.settings-tabs{display:grid;gap:7px;position:sticky;top:88px}
.settings-tab{width:100%;display:grid;grid-template-columns:32px 1fr;gap:1px 10px;align-items:center;padding:13px 14px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--ink);text-align:left;cursor:pointer}
.settings-tab>span{grid-row:1/3;width:32px;height:32px;display:grid;place-items:center;border-radius:9px;background:var(--ground);color:var(--muted);font-size:16px}
.settings-tab b{font-size:13px}.settings-tab small{font-size:10px;color:var(--muted);font-weight:500}
.settings-tab:hover{background:var(--paper);border-color:var(--line)}
.settings-tab.active{background:#eaf2fb;border-color:#d4e4f2;color:#2469ae}.settings-tab.active>span{background:#dcecf9;color:#2469ae}
.settings-content{overflow:hidden}.settings-form{padding:0!important}.settings-pane{display:none;padding:30px 32px}.settings-pane.active{display:block}
.settings-section-head{padding-bottom:22px;border-bottom:1px solid var(--line);margin-bottom:24px}.settings-kicker{display:block;margin-bottom:5px;color:#6d8ca5;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.settings-section-head h2{margin:0 0 6px;font-size:23px;letter-spacing:-.5px}.settings-section-head p{margin:0;color:var(--muted);font-size:13px}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 18px}.settings-grid-small{max-width:420px;margin-top:20px}.settings-grid label{margin-top:0}.settings-grid input,.settings-grid select{min-height:42px}
.settings-switch-list{display:grid;margin-top:10px;border:1px solid var(--line);border-radius:13px;overflow:hidden}.setting-switch{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:20px;align-items:center;margin:0;padding:17px 18px;border-bottom:1px solid var(--line);cursor:pointer}.setting-switch:last-child{border-bottom:0}.setting-switch>span b,.setting-switch>span small{display:block}.setting-switch>span b{font-size:13px;color:var(--ink)}.setting-switch>span small{margin-top:3px;color:var(--muted);font-size:11px;font-weight:500;line-height:1.45}.setting-switch input{position:absolute;opacity:0;pointer-events:none}.setting-switch>i{position:relative;width:42px;height:24px;border-radius:999px;background:#d7dee4;transition:.2s}.setting-switch>i:after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:white;box-shadow:0 1px 4px rgba(0,0,0,.18);transition:.2s}.setting-switch input:checked+i{background:#2b75b9}.setting-switch input:checked+i:after{transform:translateX(18px)}
.settings-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 32px;border-top:1px solid var(--line);background:var(--ground)}.settings-footer p{font-size:11px}.settings-saved{color:#26785d!important;font-weight:700}
:root[data-theme="dark"] .settings-tab.active{background:#17334b;border-color:#294c68;color:#8dccf7}:root[data-theme="dark"] .settings-tab.active>span{background:#20445f;color:#9ed5fb}:root[data-theme="dark"] .setting-switch>i{background:#3a4c5d}:root[data-theme="dark"] .settings-footer{background:#101b27}
@media(min-width:901px){
  .sidebar.is-collapsed .sidebar-header{display:grid!important;grid-template-columns:1fr!important;justify-items:center!important;gap:0!important;padding:0 0 12px!important}
  .sidebar.is-collapsed .sidebar-header .brand{display:none!important}
  .sidebar.is-collapsed .sidebar-header .sidebar-toggle{margin:0 auto!important;width:34px!important;height:34px!important}
  .sidebar.is-collapsed .nav-item{justify-content:center!important;padding-left:0!important;padding-right:0!important;gap:0!important}
  .sidebar.is-collapsed .nav-item>span:first-child{width:20px!important;text-align:center!important;margin:0!important}
}
@media(max-width:900px){.settings-layout{grid-template-columns:1fr}.settings-tabs{position:static;display:flex;overflow-x:auto;gap:7px;padding-bottom:4px}.settings-tab{flex:0 0 auto;width:auto;min-width:145px;grid-template-columns:28px 1fr;padding:10px 12px}.settings-tab>span{width:28px;height:28px}.settings-content{min-width:0}.settings-pane{padding:24px 22px}}
@media(max-width:600px){.settings-heading>.primary{width:100%}.settings-grid{grid-template-columns:1fr}.settings-pane{padding:20px 16px}.settings-footer{padding:16px;align-items:stretch;flex-direction:column}.settings-footer .soft-button{width:100%}.setting-switch{grid-template-columns:minmax(0,1fr) 42px;padding:15px 14px}.settings-tab small{display:none}.settings-tab{min-width:auto}}


/* V14 — iPhone opent beheer direct op 1:1 schaal */
@media(max-width:600px){
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea{font-size:16px!important}
  html,body{width:100%;min-width:0}
  .shell,main,.page{min-width:0;max-width:100%}
}


/* V15 — exacte sidebar-uitlijning + strakke instellingenvelden */
@media(min-width:901px){
  .sidebar.is-collapsed{--compact-nav-inner:56px}
  .sidebar.is-collapsed .sidebar-header{width:var(--compact-nav-inner)!important;margin:0 auto!important;display:flex!important;justify-content:center!important;align-items:center!important;padding:0 0 12px!important}
  .sidebar.is-collapsed .sidebar-header .sidebar-toggle{display:grid!important;margin:0!important;justify-self:auto!important;transform:none!important}
  .sidebar.is-collapsed .nav-item{width:var(--compact-nav-inner)!important;margin-left:auto!important;margin-right:auto!important;display:flex!important;justify-content:center!important}
  .sidebar.is-collapsed .nav-item>span:first-child{width:34px!important;min-width:34px!important;height:34px!important;display:grid!important;place-items:center!important;text-align:center!important}
}
.settings-grid{gap:14px 28px!important}
.settings-grid>label{display:grid!important;grid-template-columns:minmax(150px,190px) minmax(180px,1fr);align-items:center;gap:14px;margin:0!important;min-height:48px;color:var(--ink)}
.settings-grid>label>input,.settings-grid>label>select{width:100%!important;min-width:0;margin:0!important}
.settings-grid-small>label{grid-template-columns:minmax(180px,220px) minmax(180px,1fr)}
.settings-portal-mount{margin-top:4px}
.settings-portal-form{display:block}
.settings-portal-form .portal-intro{margin-top:0}
.settings-portal-form h3{margin:0 0 12px;font-size:16px}
.settings-portal-actions{display:flex;align-items:center;gap:14px;margin-top:18px}
.settings-portal-actions .portal-save-status{margin:0;color:var(--muted);font-size:12px}
@media(max-width:1100px) and (min-width:901px){
  .settings-grid>label{grid-template-columns:1fr;gap:6px;align-items:start}
}
@media(max-width:600px){
  .settings-grid>label,.settings-grid-small>label{grid-template-columns:1fr;gap:6px;align-items:start}
  .settings-portal-actions{align-items:stretch;flex-direction:column}
  .settings-portal-actions .primary{width:100%}
}


/* v16 — organisatielogo in topbar en upload bij Organisatie */
.topbar-organization-logo{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:46px;max-width:240px;display:flex;align-items:center;justify-content:center;pointer-events:none}
.topbar-organization-logo[hidden]{display:none}
.topbar-organization-logo img{display:block;max-width:100%;max-height:42px;object-fit:contain}
.organization-logo-settings{padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid var(--line)}
.organization-logo-heading strong,.organization-logo-heading small{display:block}.organization-logo-heading small{margin-top:4px;color:var(--muted);font-size:12px}
.organization-logo-control{display:grid;grid-template-columns:150px minmax(0,1fr);gap:18px;align-items:center;margin-top:16px}
.organization-logo-preview{height:86px;border:1px dashed var(--line);border-radius:12px;background:var(--ground);display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--muted);font-size:11px}
.organization-logo-preview img{display:block;max-width:90%;max-height:70px;object-fit:contain}
.organization-logo-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.organization-logo-actions small{flex-basis:100%;color:var(--muted);font-size:11px}.organization-logo-upload{cursor:pointer;margin:0}
@media(max-width:900px){.topbar-organization-logo{max-width:150px;height:38px}.topbar-organization-logo img{max-height:34px}}
@media(max-width:600px){.topbar-organization-logo{display:none!important}.organization-logo-control{grid-template-columns:1fr}.organization-logo-preview{height:76px}}


/* v19 — medewerkers: sticky detailpaneel en betrouwbaar bewerkvenster */
#employeeDialog .dialog-close{display:grid!important;place-items:center!important;position:absolute!important;top:16px!important;left:16px!important;right:auto!important;width:34px!important;height:34px!important;margin:0!important;padding:0!important;border:1px solid var(--line)!important;border-radius:9px!important;background:var(--paper)!important;color:var(--ink)!important;font-size:23px!important;line-height:1!important;z-index:3}
#employeeDialog form{padding-top:62px!important}
@media (min-width:901px){
  #people .employee-directory .employee-detail{position:sticky!important;top:88px!important;align-self:start!important;max-height:calc(100vh - 108px);overflow:auto;z-index:2}
  #people .employee-directory .directory-alphabet{position:sticky!important;top:88px!important;align-self:start!important}
}
@media (max-width:900px){
  #people .employee-directory .employee-detail{position:static!important;max-height:none;overflow:visible}
}


/* v20 — mooier organisatielogo placeholder */
.organization-logo-control{align-items:start}
.organization-logo-preview{position:relative;height:104px;border:1px dashed var(--line);border-radius:16px;background:linear-gradient(180deg,var(--paper),var(--ground));display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--muted);font-size:11px;padding:10px}
.organization-logo-preview-shell{width:100%;height:100%;border-radius:12px;background:linear-gradient(180deg,rgba(61,130,201,.08),rgba(61,130,201,.02));border:1px solid rgba(61,130,201,.12);display:flex;flex-direction:column;overflow:hidden}
.organization-logo-preview-topbar{height:16px;background:linear-gradient(90deg,rgba(36,105,174,.16),rgba(36,105,174,.04));border-bottom:1px solid rgba(36,105,174,.12)}
.organization-logo-preview-center{flex:1;display:grid;place-items:center;justify-items:center;text-align:center;padding:8px 10px;gap:4px}
.organization-logo-preview-center strong{font-size:12px;color:var(--ink)}
.organization-logo-preview-center small{font-size:10px;color:var(--muted);max-width:120px;line-height:1.35}
.organization-logo-preview-badge{width:34px;height:34px;border-radius:11px;background:#eaf2fb;color:#2469ae;display:grid;place-items:center;box-shadow:0 8px 18px rgba(36,105,174,.12)}
.organization-logo-preview-badge svg{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.organization-logo-preview img{display:block;max-width:92%;max-height:78px;object-fit:contain}
:root[data-theme="dark"] .organization-logo-preview{background:linear-gradient(180deg,#101b27,#0d1722);border-color:#223648}
:root[data-theme="dark"] .organization-logo-preview-shell{background:linear-gradient(180deg,rgba(94,161,235,.13),rgba(94,161,235,.04));border-color:rgba(110,178,242,.16)}
:root[data-theme="dark"] .organization-logo-preview-topbar{background:linear-gradient(90deg,rgba(94,161,235,.18),rgba(94,161,235,.06));border-bottom-color:rgba(110,178,242,.12)}
:root[data-theme="dark"] .organization-logo-preview-badge{background:#17334b;color:#8dccf7;box-shadow:none}
@media(max-width:600px){.organization-logo-preview{height:96px}}


/* v21 — eenvoudige, rustige organisatielogo-preview */
.organization-logo-preview{height:96px;padding:0;border:1px dashed #cfd9e2;border-radius:14px;background:var(--ground)}
.organization-logo-preview img[hidden]{display:none!important}
.organization-logo-preview img{max-width:90%;max-height:76px;object-fit:contain}
.organization-logo-empty{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:var(--muted);text-align:center}
.organization-logo-empty[hidden]{display:none!important}
.organization-logo-empty svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;opacity:.8}
.organization-logo-empty span{font-size:11px;font-weight:650}
:root[data-theme="dark"] .organization-logo-preview{background:#101b27;border-color:#304353}


/* v22 — duidelijke opslagstatus instellingen */
#settingsStatus.settings-saved{color:#267a58;font-weight:700}
#settingsStatus.settings-error{color:#b64d45;font-weight:700}
#saveSettingsButton:disabled{opacity:.78;cursor:wait}
:root[data-theme="dark"] #settingsStatus.settings-saved{color:#8ed6b5}
:root[data-theme="dark"] #settingsStatus.settings-error{color:#ff9d94}


/* v23 — voorbeeld datumnotatie */
.settings-field-preview{display:block;margin-top:7px;color:var(--muted);font-size:10px;font-weight:500}.settings-field-preview strong{color:var(--ink);font-weight:700}


/* v24 — mobiele instellingentabs uitlijnen + duidelijke toggle-status */
.setting-switch>i{
  background:#cfd8e2;
  border:1px solid #bec9d5;
}
.setting-switch input:checked+i{
  background:#72b9ee;
  border-color:#72b9ee;
  box-shadow:0 0 0 2px rgba(114,185,238,.12);
}
:root[data-theme="dark"] .setting-switch>i{
  background:#415164;
  border-color:#536579;
}
:root[data-theme="dark"] .setting-switch input:checked+i{
  background:#5aa9e6;
  border-color:#6bb6ed;
  box-shadow:0 0 0 2px rgba(90,169,230,.14);
}
@media(max-width:900px){
  .settings-tabs{align-items:stretch}
  .settings-tab{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    text-align:left;
  }
  .settings-tab>span{flex:0 0 28px;grid-row:auto}
  .settings-tab b{display:block;text-align:left;white-space:nowrap}
}
@media(max-width:600px){
  .settings-tab{padding:10px 12px;min-width:max-content}
  .settings-tab b{font-size:13px}
}

/* V26 — medewerkers: scrollbare lijst links, vast inline detail/bewerkpaneel rechts */
@media (min-width:901px){
  #people.active-page{height:calc(100vh - 70px);overflow:hidden;padding-bottom:26px!important}
  #people .page-heading{flex:0 0 auto}
  #people .person-grid{min-height:0}
  #people .employee-directory{height:calc(100vh - 205px);min-height:430px;grid-template-columns:minmax(0,1.55fr) minmax(360px,.92fr) 28px;align-items:stretch}
  #people .employee-directory .directory-list{height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  #people .employee-directory .employee-detail{position:relative!important;top:auto!important;align-self:stretch!important;height:100%;max-height:none!important;overflow-y:auto;overscroll-behavior:contain;z-index:2}
  #people .employee-directory .directory-alphabet{position:relative!important;top:auto!important;align-self:start!important;max-height:100%;overflow-y:auto}
}
.employee-detail-editor{padding:0!important}
.employee-inline-form{display:block!important;padding:24px!important;position:static!important;background:transparent!important}
.employee-inline-form .eyebrow{margin-bottom:5px}
.employee-inline-form h2{margin:0 0 18px;font-size:21px}
.employee-inline-form label{display:block;margin:10px 0;color:var(--ink)}
.employee-inline-form input,.employee-inline-form select{width:100%;min-height:40px;margin-top:6px;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink)}
.employee-inline-form .form-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
.employee-inline-form .availability-editor{margin-top:16px}
.employee-inline-form .availability-row{grid-template-columns:minmax(110px,1fr) 88px 12px 88px;gap:7px}
.employee-inline-form .availability-row label{margin:0!important}
.employee-inline-form .availability-row input[type="checkbox"]{width:16px!important;min-height:16px!important;margin:0!important}
.employee-inline-form .availability-row input[type="time"]{min-height:32px;margin:0;padding:5px 6px;font-size:11px}
.employee-inline-form .employee-form-actions{display:grid;grid-template-columns:auto 1fr auto;gap:9px;margin-top:16px}
.employee-inline-form .employee-form-actions .soft-button{grid-column:1}
.employee-inline-form .employee-form-actions .primary{grid-column:2;margin:0;width:100%}
.employee-inline-form .employee-form-actions .danger-button{grid-column:3}
.employee-inline-form .employee-save-status{margin:12px 0 0;padding:9px 11px;border-radius:8px;background:#e7f5ec;color:#26734b;font-size:12px;font-weight:700}
.employee-inline-form .employee-save-status.error{background:#fff0f0;color:#a54545}
.employee-empty-list{padding:24px}
:root[data-theme="dark"] .employee-inline-form input,:root[data-theme="dark"] .employee-inline-form select{background:#172431;border-color:#35495b;color:#edf4fb;color-scheme:dark}
@media (max-width:900px){
  #people .employee-directory{grid-template-columns:1fr!important}
  #people .employee-directory .directory-list{max-height:none;overflow:visible}
  #people .employee-directory .employee-detail{position:static!important;height:auto;max-height:none!important;overflow:visible}
  .employee-inline-form{padding:20px!important}
}
@media (max-width:600px){
  .employee-inline-form .form-grid{grid-template-columns:1fr!important;gap:0!important}
  .employee-inline-form .availability-row{grid-template-columns:minmax(90px,1fr) 76px 10px 76px}
  .employee-inline-form .employee-form-actions{grid-template-columns:1fr 1fr}
  .employee-inline-form .employee-form-actions .soft-button{grid-column:1}
  .employee-inline-form .employee-form-actions .primary{grid-column:1/-1;grid-row:1}
  .employee-inline-form .employee-form-actions .danger-button{grid-column:2}
}


/* V27 — medewerkers: alfabet tussen lijst en detail, frisse sluitknop en rustige acties */
@media (min-width:901px){
  #people .employee-directory{grid-template-columns:minmax(0,1.55fr) 34px minmax(360px,.92fr)!important;column-gap:10px!important}
  #people .employee-directory .directory-alphabet{grid-column:2;grid-row:1;justify-self:center;align-self:start!important;padding-top:4px;overflow:visible!important}
  #people .employee-directory .employee-detail{grid-column:3;grid-row:1}
}
.employee-inline-close{display:grid;place-items:center;width:34px;height:34px;margin:0 0 8px;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--muted);cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
.employee-inline-close svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}
.employee-inline-close:hover{background:#eaf2fb;border-color:#c9deef;color:#2469ae}
.employee-inline-close:active{transform:scale(.96)}
:root[data-theme="dark"] .employee-inline-close{background:#172431;border-color:#35495b;color:#aebdca}
:root[data-theme="dark"] .employee-inline-close:hover{background:#1d3850;border-color:#41617c;color:#9ed5fb}
.employee-inline-form .employee-form-actions{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important;align-items:center!important;margin-top:16px!important}
.employee-inline-form .employee-form-actions .primary{grid-column:1!important;grid-row:1!important;width:100%!important;min-height:40px;margin:0!important}
.employee-inline-form .employee-form-actions .danger-button{grid-column:2!important;grid-row:1!important;min-height:40px!important;margin:0!important;padding:0 15px!important;border:1px solid #e3b4b0!important;border-radius:9px!important;background:var(--paper)!important;color:#b44f47!important;font-weight:650!important}
.employee-inline-form .employee-form-actions .danger-button:hover{background:#fff4f3!important;border-color:#d9908a!important}
:root[data-theme="dark"] .employee-inline-form .employee-form-actions .danger-button{background:#172431!important;border-color:#704b4b!important;color:#f2a39c!important}
@media(max-width:900px){
  #people .employee-directory .directory-alphabet{display:flex!important;position:static!important;grid-row:auto!important;grid-column:auto!important;overflow-x:auto!important;max-width:100%;padding:4px 0 8px;gap:2px}
  #people .employee-directory .directory-alphabet button{flex:0 0 25px}
}
@media(max-width:600px){
  .employee-inline-form .employee-form-actions{grid-template-columns:minmax(0,1fr) auto!important}
  .employee-inline-form .employee-form-actions .primary{grid-column:1!important;grid-row:1!important}
  .employee-inline-form .employee-form-actions .danger-button{grid-column:2!important;grid-row:1!important}
}


/* V28 — medewerkers: strakkere veldrastering en compactere kop */
.employee-inline-form{padding-top:14px!important}
.employee-inline-close{margin-bottom:4px!important}
.employee-inline-form .eyebrow{margin:0 0 3px!important}
.employee-inline-form h2{margin:0 0 16px!important}
.employee-inline-form .form-grid{align-items:start!important}
.employee-inline-form .form-grid>label{display:grid!important;grid-template-rows:auto 42px 16px;align-content:start;margin:8px 0 4px!important;min-width:0}
.employee-inline-form .form-grid>label>input,.employee-inline-form .form-grid>label>select{height:42px!important;min-height:42px!important;margin-top:6px!important;align-self:start}
.employee-inline-form .form-grid>label>small{display:block;min-height:16px;margin-top:3px;line-height:13px;font-size:10px;color:var(--muted)}
.employee-inline-form .form-grid>label:not(:has(small))::after{content:"";display:block;min-height:16px;margin-top:3px}
@media(max-width:600px){
  .employee-inline-form{padding-top:12px!important}
  .employee-inline-form .form-grid>label{grid-template-rows:auto 42px 16px}
}


/* V30 — medewerkerformulier: compacte kop en ruimere initialen-hulptekst */
.employee-inline-form .eyebrow{display:none!important}
.employee-inline-form h2{margin-top:0!important;margin-bottom:18px!important}
.employee-inline-form .form-grid>label>small#initialsHelp{margin-top:7px!important;line-height:14px!important}


/* V31 — medewerkers responsive detailmodus + duidelijk mobiel alfabet */
.employee-mobile-back{display:none}
@media(max-width:900px){
  #people .employee-directory{display:grid!important;grid-template-columns:1fr!important;height:auto!important;min-height:0!important;gap:10px!important}
  #people .employee-directory .directory-alphabet{grid-row:1!important;display:flex!important;order:1;overflow-x:auto!important;overflow-y:hidden!important;max-width:100%;padding:2px 0 7px!important;gap:3px!important;scrollbar-width:none}
  #people .employee-directory .directory-alphabet::-webkit-scrollbar{display:none}
  #people .employee-directory .directory-alphabet button{flex:0 0 30px!important;width:30px!important;height:30px!important;border-radius:8px!important}
  #people .employee-directory .directory-list{grid-row:2!important;order:2;display:block;max-height:none!important;overflow:visible!important}
  #people .employee-directory .employee-detail{grid-row:3!important;order:3;display:none!important;position:static!important;height:auto!important;max-height:none!important;overflow:visible!important}
  #people .employee-directory.mobile-detail-open .directory-list,
  #people .employee-directory.mobile-detail-open .directory-alphabet{display:none!important}
  #people .employee-directory.mobile-detail-open .employee-detail{display:block!important;grid-row:1!important}
  .employee-mobile-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 15px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink);font:inherit;font-size:12px;font-weight:650;cursor:pointer}
  .employee-mobile-back svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .employee-detail-editor .employee-mobile-back-editor{margin:14px 14px 0}
  .employee-directory-row{min-height:58px}
}
@media(max-width:600px){
  #people .page-heading{gap:12px}
  #people .page-heading .primary{width:auto!important;align-self:flex-start}
  #people .employee-directory .directory-alphabet button{flex-basis:28px!important;width:28px!important;height:28px!important;font-size:10px}
  #people .employee-detail{border-radius:14px}
}


/* V32 — iPhone medewerkers: knop naast titel + verticale alfabetnavigatie rechts */
@media(max-width:600px){
  #people .page-heading{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:10px 12px!important;
  }
  #people .page-heading>div{
    flex:initial!important;
    min-width:0!important;
  }
  #people .page-heading .primary,
  #people #newPersonButton{
    grid-column:2!important;
    grid-row:1!important;
    width:auto!important;
    min-width:0!important;
    align-self:start!important;
    justify-self:end!important;
    margin:0!important;
    padding:12px 14px!important;
    min-height:46px!important;
    white-space:nowrap!important;
  }
  #people .employee-directory{
    position:relative!important;
    gap:12px!important;
  }
  #people .employee-directory .directory-list{
    padding-right:0!important;
  }
  #people .employee-directory .directory-alphabet{
    position:fixed!important;
    top:50%!important;
    right:calc(3px + env(safe-area-inset-right))!important;
    transform:translateY(-50%)!important;
    z-index:25!important;
    display:grid!important;
    grid-auto-rows:min-content!important;
    justify-items:center!important;
    align-content:center!important;
    gap:0!important;
    width:20px!important;
    max-height:calc(100dvh - 120px)!important;
    overflow:visible!important;
    padding:0!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  #people .employee-directory .directory-alphabet button{
    flex:initial!important;
    width:20px!important;
    height:18px!important;
    min-height:18px!important;
    padding:0!important;
    border-radius:5px!important;
    font-size:10px!important;
    font-weight:750!important;
    background:transparent!important;
  }
  #people .employee-directory.mobile-detail-open .directory-alphabet{
    display:none!important;
  }
}

/* V36 — mobiel medewerkersdetail: één compacte terugactie, geen dubbel sluitkruis */
@media(max-width:900px){
  #people .employee-mobile-back{
    display:inline-flex!important;
    align-items:center!important;
    gap:4px!important;
    margin:0 0 14px!important;
    padding:0!important;
    min-height:28px!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    color:#2469ae!important;
    font:inherit!important;
    font-size:13px!important;
    font-weight:650!important;
  }
  #people .employee-mobile-back svg{
    width:16px!important;
    height:16px!important;
    stroke-width:2.2!important;
  }
  #people .employee-detail-editor .employee-mobile-back-editor{
    margin:0 0 10px!important;
  }
  #people .employee-detail-editor .employee-inline-close{
    display:none!important;
  }
  #people .employee-detail-editor .employee-inline-form{
    padding:0!important;
  }
  #people .employee-detail-editor .employee-inline-form h2{
    margin:0 0 18px!important;
  }
}
@media(max-width:600px){
  #people .employee-detail{
    padding:21px!important;
  }
  #people .employee-mobile-back{
    margin-bottom:12px!important;
  }
  #people .employee-detail-head{
    padding-top:0!important;
  }
}
