:root{
  --orange:#ff6720; --orange-deep:#c2410c; --orange-tint:#fff0e6; --orange-line:#ffb48a;
  --ink:#1c1d26; --muted:#5d6272; --cream:#fffaf6; --white:#fff;
  --radius:14px;
  --font:"Segoe UI","Helvetica Neue",Arial,sans-serif;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;font-family:var(--font);color:var(--ink);
  background:linear-gradient(180deg,var(--white) 0,var(--cream) 320px,var(--white) 100%)}
img{max-width:100%;height:auto;display:block}
a{color:inherit}
:focus-visible{outline:3px solid var(--orange);outline-offset:3px;border-radius:6px}

/* Header */
.site-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px clamp(16px,2vw,36px);flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:22px;min-width:0}
.brand__logo-link{display:block;flex:none}
.brand__logo{width:clamp(120px,11.5vw,220px);mix-blend-mode:multiply} /* white logo background blends into the page; pixels are untouched */
.brand__text{padding-left:22px;border-left:1px solid #555;min-height:56px;display:flex;flex-direction:column;justify-content:center}
.brand__title{margin:0;font-size:clamp(1.6rem,3.6vw,2.7rem);line-height:1;font-weight:900;letter-spacing:.01em;color:var(--orange)}
.brand__title--sm{font-size:clamp(1.3rem,2.6vw,1.9rem)}
.brand__subtitle{margin:6px 0 0;font-size:clamp(.9rem,1.5vw,1.2rem);color:var(--muted)}
.btn-outline{display:inline-block;padding:11px 20px;border:1.5px solid var(--orange);border-radius:10px;color:var(--orange-deep);font-weight:700;text-decoration:none;background:var(--white);transition:background .15s,color .15s}
.btn-outline:hover:not(:disabled){background:var(--orange-deep);color:var(--white)}

.page{flex:1;width:100%;max-width:1900px;margin:0 auto;padding:0 clamp(16px,2vw,36px) 28px}

/* Clock widget: fixed box, fixed border, tabular digits */
.clock-widget{display:grid;grid-template-columns:1fr 1fr;width:540px;max-width:100%;height:134px;margin:6px auto 22px;
  border:1px solid var(--orange);border-radius:12px;background:var(--cream);overflow:hidden}
.clock{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:0 10px;min-width:0;text-align:center}
.clock + .clock{border-left:1px solid var(--orange-line)}
.clock__flag{display:block;width:36px;height:24px;flex:none;margin:0 auto;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.08)}
.clock__body{display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0}
.clock__label{font-size:.82rem;font-weight:600;white-space:nowrap}
.clock__time{font-size:2.15rem;font-weight:700;line-height:1.15;width:8ch;text-align:center;font-variant-numeric:tabular-nums;letter-spacing:.01em}
.clock__date{font-size:.8rem;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums;min-height:1.1em}

/* Department grid */
.section-title{margin:0 0 14px;padding-left:14px;border-left:4px solid var(--orange);font-size:clamp(1.15rem,2.2vw,1.7rem);font-weight:800}
.dept-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:20px}
.dept-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;min-height:320px;padding:20px 16px 70px;
  border:1px solid var(--orange);border-radius:var(--radius);background:var(--white);text-decoration:none;text-align:center;
  transition:box-shadow .18s,border-color .18s,transform .18s}
.dept-card:hover{box-shadow:0 8px 22px rgba(255,103,32,.16);transform:translateY(-2px);border-color:var(--orange-deep)}
.dept-card__icon{display:grid;place-items:center;width:72px;height:72px;border-radius:50%;background:var(--orange-tint);color:var(--orange-deep)}
.dept-card__name{font-size:.95rem;font-weight:800;letter-spacing:.02em;text-transform:uppercase;line-height:1.3}
.dept-card__kpi{width:100%}
.dept-card__go{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--orange);color:var(--white)}

/* Footer */
.footer-banner{width:100%;aspect-ratio:1536/246;min-height:96px;max-height:280px;overflow:hidden;background:var(--white)}
.footer-banner img{width:100%;height:100%;object-fit:cover;object-position:center}
.site-footer{padding:14px 16px;text-align:center;font-size:.85rem;color:var(--muted);border-top:1px solid var(--orange-tint);background:var(--white)}

/* Department page shell */
.back-link{display:inline-block;margin:10px 0 14px;font-weight:600;color:var(--orange-deep)}
.dept-head{display:flex;align-items:center;gap:14px;margin-bottom:18px}
.dept-head__icon{display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:var(--orange-tint);color:var(--orange-deep)}
.dept-head__icon:empty{display:none}
.dept-head__title{margin:0;font-size:clamp(1.4rem,3vw,2rem);font-weight:800}
.shell{border:1px solid var(--orange);border-radius:var(--radius);background:var(--white);padding:22px}
.shell__kpi-area{min-height:260px;border:1px dashed var(--orange-line);border-radius:10px;padding:18px;display:flex;align-items:flex-start}
.shell__note{margin:0;color:var(--muted);max-width:60ch;line-height:1.5}

/* Responsive */
@media (max-width:1180px){.dept-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.dept-card{min-height:240px}}
@media (max-width:760px){.dept-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.dept-card{min-height:200px}
  .brand__text{padding-left:14px}.brand{gap:14px}}
@media (max-width:560px){
  .clock-widget{grid-template-columns:1fr;height:auto;width:min(340px,100%)}
  .clock{height:112px}
  .clock + .clock{border-left:0;border-top:1px solid var(--orange-line)}
  .site-header{justify-content:center}
}
@media (max-width:420px){.dept-grid{grid-template-columns:1fr}.dept-card{min-height:170px}}

/* Main dashboard: fit the screen with no scrolling on desktop/laptop. Smaller screens scroll normally. */
@media (min-width:1181px) and (min-height:560px){
  body.home{height:100vh;height:100dvh;overflow:hidden}
  body.home .site-header{padding-top:8px;padding-bottom:8px}
  body.home .page{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;padding-bottom:14px}
  body.home .clock-widget{height:clamp(92px,13vh,134px);margin:0 auto clamp(8px,1.8vh,20px);flex:none}
  body.home .clock__time{font-size:clamp(1.6rem,3.6vh,2.15rem)}
  body.home .section-title{flex:none;margin-bottom:clamp(8px,1.4vh,14px)}
  body.home .dept-grid{flex:1 1 auto;min-height:0;grid-template-rows:minmax(0,1fr)}
  body.home .dept-card{min-height:0;height:100%;gap:clamp(8px,1.6vh,14px);padding-top:clamp(12px,2.4vh,20px);padding-bottom:clamp(52px,7vh,70px)}
  body.home .dept-card__icon{width:clamp(52px,8vh,72px);height:clamp(52px,8vh,72px)}
  body.home .dept-card__go{bottom:clamp(10px,2vh,18px)}
  body.home .footer-banner{flex:none;aspect-ratio:auto;min-height:0;max-height:none;height:clamp(90px,27vh,300px)}
  body.home .site-footer{flex:none;padding:8px 16px}
}


/* Fit-to-screen on desktop/laptop: the cards take whatever height is left, so the page needs no scrolling */
@media (min-width:1181px){
  body.home{height:100vh;height:100dvh}
  .home .page{display:flex;flex-direction:column;min-height:0;padding-bottom:14px}
  .home .dept-grid{flex:1;min-height:150px}
  .home .dept-card{min-height:0;padding:16px 14px 58px;gap:10px}
  .home .dept-card__go{bottom:14px}
  .footer-banner{flex:none;aspect-ratio:auto;min-height:0;height:clamp(70px,16vh,200px)}
  .home .site-footer{flex:none;padding:10px 16px}
}
@media (min-width:1181px) and (max-height:820px){
  .home .site-header{padding-top:8px;padding-bottom:6px}
  .home .brand__text{min-height:48px}
  .clock-widget{height:100px;margin:0 auto 12px}
  .clock__time{font-size:1.75rem}
  .section-title{margin-bottom:10px}
  .dept-card__icon{width:56px;height:56px}
  .dept-card__icon svg{width:28px;height:28px}
}

/* Auth pages */
.auth-card{max-width:460px;margin:28px auto;padding:26px;border:1px solid var(--orange);border-radius:var(--radius);background:var(--white)}
.auth-card__title{margin:0 0 14px;font-size:1.5rem;font-weight:800}
.auth-card label{display:block;margin:14px 0 6px;font-weight:600;font-size:.92rem}
.auth-card input{width:100%;padding:11px 12px;font:inherit;border:1px solid #c9ccd6;border-radius:8px;background:var(--white)}
.auth-card input:focus-visible{outline:3px solid var(--orange-line);border-color:var(--orange)}
.btn-primary{width:100%;margin-top:18px;padding:12px;font:inherit;font-weight:700;color:var(--white);background:var(--orange-deep);border:0;border-radius:10px;cursor:pointer}
.btn-primary:hover:not(:disabled){background:#9a3412} .btn-primary:disabled,.link-btn:disabled,.btn-outline:disabled{opacity:.6;cursor:wait}
.link-btn{background:none;border:0;padding:0;font:inherit;color:var(--orange-deep);text-decoration:underline;cursor:pointer}
.muted{color:var(--muted);font-size:.88rem;line-height:1.5}
.notice{margin:0 0 6px;padding:10px 12px;border-radius:8px;font-size:.92rem;line-height:1.45}
.notice--error{background:#fdecea;color:#8a1c14;border:1px solid #f4b4ae}
.notice--ok{background:#e9f7ef;color:#14532d;border:1px solid #a7dcbc}
.notice--info{background:var(--orange-tint);color:#7a3000;border:1px solid var(--orange-line)}
.kv{display:grid;grid-template-columns:90px 1fr;gap:8px 12px;margin:0 0 14px}.kv dt{font-weight:600;color:var(--muted)}.kv dd{margin:0;word-break:break-word}
.dept-list{padding-left:18px;margin:0 0 18px;line-height:1.8}

/* Admin pages */
.head-links{display:flex;gap:10px;flex-wrap:wrap}
.admin{max-width:1200px}
.admin-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap;margin:6px 0 16px}
.admin-title{margin:0;font-size:clamp(1.4rem,3vw,1.9rem);font-weight:800;color:var(--orange-deep)}
.admin-actions{display:flex;gap:10px;flex-wrap:wrap}
.btn-solid,.btn-danger{padding:10px 18px;font:inherit;font-weight:700;border:0;border-radius:10px;cursor:pointer;color:var(--white);background:var(--orange-deep)}
.btn-solid:hover:not(:disabled){background:#9a3412} .btn-danger{background:#b3261e}
.btn-solid:disabled,.btn-danger:disabled,.btn-outline:disabled{opacity:.55;cursor:not-allowed}
.btn-outline{font:inherit;cursor:pointer}
.panel{border:1px solid var(--orange);border-radius:var(--radius);background:var(--white);padding:18px;margin-bottom:18px}
.panel__title{margin:0 0 6px;font-size:1.1rem}
.toolbar{display:grid;grid-template-columns:2fr repeat(4,1fr) auto;gap:10px;margin-bottom:12px}
.toolbar input,.toolbar select,.dlg input,.dlg select,.dlg textarea{width:100%;padding:9px 10px;font:inherit;border:1px solid #c9ccd6;border-radius:8px;background:var(--white);min-width:0}
.table-wrap{overflow-x:auto}
table.grid{width:100%;border-collapse:collapse}
table.grid th{padding:10px;text-align:left;font-size:.82rem;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);background:var(--cream);border-bottom:1px solid var(--orange-line)}
table.grid td{padding:0 10px;height:46px;border-bottom:1px solid #f0e4da;white-space:nowrap}
.badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.8rem;font-weight:700;background:#ececf1;color:#44475a}
.badge--approved{background:#e0f4e8;color:#14532d}.badge--rejected{background:#fde4e2;color:#8a1c14}
.pager{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap}
.empty{padding:26px;text-align:center;color:var(--muted)}
.dlg{width:min(720px,94vw);max-height:92vh;padding:0;border:1px solid var(--orange);border-radius:var(--radius)} .dlg--wide{width:min(860px,94vw)}
.dlg::backdrop{background:rgba(20,20,30,.45)}
.dlg__body{padding:22px;overflow:auto;max-height:90vh}.dlg__title{margin:0 0 12px;font-size:1.3rem}
.dlg label{display:block;margin:12px 0 5px;font-weight:600;font-size:.9rem}
.dlg__foot{display:flex;align-items:center;gap:10px;margin-top:18px;flex-wrap:wrap}.grow{flex:1}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.form-grid .wide{grid-column:1/-1}
.form-grid textarea{min-height:110px;resize:vertical}
.opt-list{list-style:none;margin:12px 0;padding:0;max-height:240px;overflow:auto;border:1px solid #eee;border-radius:8px}
.opt-list li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px 10px;border-bottom:1px solid #f3f3f3}
.opt-list .off{color:#999;text-decoration:line-through}.opt-add{display:flex;gap:8px;margin-bottom:10px}
.stat-row{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}
.stat{flex:1 1 120px;padding:10px 12px;border-radius:10px;background:var(--cream);border:1px solid var(--orange-line)}
.stat b{display:block;font-size:1.4rem}.stat--bad b{color:#b3261e}.stat--ok b{color:#14532d}
.check{display:flex;gap:8px;align-items:center;margin:0!important}.check input{width:auto}
.err-table{width:100%;border-collapse:collapse;font-size:.85rem;margin-top:8px}.err-table td,.err-table th{padding:5px 8px;border-bottom:1px solid #eee;text-align:left}
@media (max-width:900px){.toolbar{grid-template-columns:1fr 1fr}.toolbar input{grid-column:1/-1}.form-grid{grid-template-columns:1fr}}

.admin #authNotice{margin-top:8px}

/* 2D charts (flat SVG) */
.c2d{position:relative}.c2d__scroll{width:100%}.c2d__svg{display:block;max-width:none;font-family:inherit}
.c2d__bar{transition:opacity .12s}.c2d__bar:hover{opacity:.82}
.c2d__tip{position:absolute;pointer-events:none;background:#1c1d26;color:#fff;font-size:.8rem;padding:6px 9px;border-radius:6px;max-width:260px;z-index:5;line-height:1.35}
.c2d__legend{display:flex;flex-wrap:wrap;gap:6px 16px;list-style:none;padding:0;margin:8px 0 0;font-size:.85rem}
.c2d__sw{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.c2d__data{margin-top:6px;font-size:.85rem}.c2d__data summary{cursor:pointer;color:var(--orange-deep)}
.c2d__tablewrap{max-height:220px;overflow:auto;margin-top:6px}.c2d__data table{border-collapse:collapse;width:100%}
.c2d__data th,.c2d__data td{padding:4px 8px;border-bottom:1px solid #eee;text-align:left}
.chart-scroll .c2d__scroll{max-height:520px;overflow-y:auto}

/* FIT & Tech dashboard */
.dash{max-width:none}
.filters label{display:block;margin:0 0 4px;font-size:.8rem;font-weight:600;color:var(--muted)}
.filters select,.filters input,.rec-search input{width:100%;padding:9px 10px;font:inherit;border:1px solid #c9ccd6;border-radius:8px;background:var(--white);min-width:0}
.filters__grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.filters__actions{display:flex;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}
.kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}
.kpi{position:relative;display:flex;flex-direction:column;justify-content:space-between;min-height:118px;padding:14px 16px;border:1px solid var(--orange-line);border-left:5px solid var(--orange);border-radius:var(--radius);overflow:hidden;background-size:cover;background-position:center}
.kpi--ok{border-left-color:#1a8f5a}.kpi--bad{border-left-color:#d64550}
.kpi--1{background-image:linear-gradient(rgba(255,255,255,.84),rgba(255,255,255,.84)),url(../assets/images/kpi/kpi-1.jpg)}
.kpi--2{background-image:linear-gradient(rgba(255,255,255,.84),rgba(255,255,255,.84)),url(../assets/images/kpi/kpi-2.jpg)}
.kpi--3{background-image:linear-gradient(rgba(255,255,255,.84),rgba(255,255,255,.84)),url(../assets/images/kpi/kpi-3.jpg)}
.kpi--4{background-image:linear-gradient(rgba(255,255,255,.84),rgba(255,255,255,.84)),url(../assets/images/kpi/kpi-4.jpg)}
.kpi--5{background-image:linear-gradient(rgba(255,255,255,.84),rgba(255,255,255,.84)),url(../assets/images/kpi/kpi-5.jpg)}
.kpi__label{font-size:.85rem;font-weight:700;color:#3a3d4a;text-transform:uppercase;letter-spacing:.03em}
.kpi__value{font-size:clamp(1.8rem,3vw,2.6rem);line-height:1.05;font-variant-numeric:tabular-nums;color:var(--ink)}
.kpi--ok .kpi__value{color:#14663f}.kpi--bad .kpi__value{color:#b3303a}.kpi--1 .kpi__value{color:var(--orange-deep)}
.charts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:6px}
.charts-grid .panel{margin-bottom:0}
.chart-hint{margin:8px 0 18px}
.rec-search{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:12px}
table.grid--pub td{max-width:260px;overflow:hidden;text-overflow:ellipsis}
table.grid--pub tr.detail td{height:auto;max-width:none;white-space:normal;background:var(--cream);padding:10px 14px;line-height:1.5}
.linkish{background:none;border:0;padding:0;font:inherit;color:var(--orange-deep);cursor:pointer;text-decoration:underline}
@media (max-width:1100px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.filters__grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:900px){.charts-grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:640px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.filters__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.rec-search{grid-template-columns:1fr auto}}

/* approval rate inside the main-dashboard FIT & Tech card: big green percentage, label underneath */
.dept-card__kpi{width:100%;margin:auto 0;display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--ink)}
.dept-card__kpi[hidden]{display:none}
.rate__num{font-size:clamp(1.9rem,2.3vw,2.8rem);font-weight:800;line-height:1;letter-spacing:.01em;color:#1fa24a;font-variant-numeric:tabular-nums}
.rate__label{font-size:1.05rem;font-weight:700;line-height:1.2;color:var(--ink)}
@media (min-width:1181px) and (max-height:760px){.dept-card__icon{width:52px;height:52px}.dept-card__icon svg{width:32px;height:32px}.rate__num{font-size:1.9rem}.rate__label{font-size:.92rem}.dept-card__kpi{gap:3px}}
@media (min-width:1181px) and (max-height:640px){.home .dept-card:has(.dept-card__kpi:not([hidden])) .dept-card__icon{display:none}}

table.grid--pub td.cmt-td{max-width:none;overflow:visible}.cmt{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap}

.hol-form{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin:10px 0 14px}.hol-form label{display:block;margin:0 0 4px;font-size:.8rem;font-weight:600;color:var(--muted)}.hol-form input{padding:9px 10px;font:inherit;border:1px solid #c9ccd6;border-radius:8px;width:100%}.hol-form .grow{flex:1;min-width:200px}.hol-list{max-height:320px;overflow:auto}
.hol-public{list-style:none;margin:0 0 6px;padding:0;display:flex;gap:8px 22px;flex-wrap:wrap}.hol-public li{padding:6px 10px;border:1px solid var(--orange-line);border-radius:8px;background:var(--cream);font-size:.9rem}
[hidden]{display:none!important}

/* Main Admin panel */
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 14px;border-bottom:2px solid var(--orange-tint)}
.tab{padding:10px 16px;font:inherit;font-weight:700;color:var(--muted);background:none;border:0;border-bottom:3px solid transparent;margin-bottom:-2px;cursor:pointer}
.tab[aria-selected="true"]{color:var(--orange-deep);border-bottom-color:var(--orange)}
.fields{border:1px solid #e6dfd8;border-radius:10px;padding:10px 12px;margin:12px 0}.fields legend{font-size:.85rem;font-weight:700;padding:0 6px}
.fields__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:6px 14px}
.dept-pick{padding:8px 0;border-bottom:1px solid #f1ebe5}.dept-pick:last-child{border:0}.dept-pick__perms{display:flex;gap:6px 16px;flex-wrap:wrap;margin:6px 0 0 26px;font-size:.88rem}
.dept-pick__perms[hidden]{display:none}
.sub{margin:16px 0 6px;font-size:1rem}.pw{display:block;padding:14px;font-size:1.2rem;letter-spacing:.04em;background:var(--cream);border:1px dashed var(--orange);border-radius:8px;word-break:break-all;user-select:all}
.toolbar--audit{grid-template-columns:1.2fr 1.2fr 1fr 1fr auto}
.kpi-edit textarea{width:100%;min-height:90px;font-family:Consolas,monospace;font-size:.85rem;padding:8px;border:1px solid #c9ccd6;border-radius:8px}
.kpi-edit{margin:10px 0;padding:10px 12px;border:1px solid #eee;border-radius:10px}.kpi-edit h4{margin:0 0 6px;font-size:.95rem}
pre.json{margin:0;white-space:pre-wrap;word-break:break-word;font-size:.8rem;background:var(--cream);padding:8px;border-radius:6px;max-width:560px}
@media (max-width:900px){.toolbar--audit{grid-template-columns:1fr 1fr}}

/* accessibility */
.skip{position:absolute;left:-9999px;top:8px;z-index:200;padding:10px 14px;background:#fff;color:var(--ink);border:2px solid var(--orange-deep);border-radius:8px;font-weight:700}
.skip:focus{left:8px}
.brand__title{color:#ea5a10}
.print-only{display:none}

/* compact clocks on short screens keep the centred stack inside the fixed box */
@media (min-width:1181px) and (max-height:820px){.clock__flag{width:30px;height:20px}.clock{gap:1px}.clock__label{font-size:.76rem}.clock__date{font-size:.74rem}}
body.home .clock__flag{width:30px;height:20px}

.loading{color:var(--muted);font-style:italic}

.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* =====================  Motion and loading states  ===================== */
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes noticeIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes dlgIn{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@keyframes shimmer{from{background-position:-150% 0}to{background-position:250% 0}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes growY{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes growX{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes pop{from{opacity:0;transform:scale(.55)}to{opacity:1;transform:scale(1)}}
@keyframes drawLine{to{stroke-dashoffset:0}}
@keyframes rowIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

html{scroll-behavior:smooth}

/* "Loading data..." overlay shown on every data card until its data has arrived */
.has-loading{position:relative}
.card-loading{position:absolute;inset:0;z-index:4;display:flex;align-items:center;justify-content:center;gap:10px;border-radius:inherit;
  font-weight:700;font-size:.92rem;color:var(--orange-deep);opacity:0;visibility:hidden;pointer-events:none;
  background:linear-gradient(100deg,rgba(255,255,255,.86) 30%,rgba(255,238,226,.93) 50%,rgba(255,255,255,.86) 70%);background-size:250% 100%;
  transition:opacity .3s ease,visibility 0s linear .3s}
[aria-busy="true"]>.card-loading{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .2s ease;animation:shimmer 1.5s linear infinite}
.spinner{flex:none;width:18px;height:18px;border:3px solid var(--orange-tint);border-top-color:var(--orange-deep);border-radius:50%;animation:spin .8s linear infinite}
.chart-ph{min-height:230px}
.chart-scroll .chart-ph{min-height:300px}

/* entrances (fill "backwards" only, so hover effects keep working afterwards) */
.dept-card{animation:rise .55s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:calc(var(--i,0)*70ms)}
.dash .panel,.dash .kpi{animation:rise .55s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:calc(var(--n,0)*55ms)}
.dash .panel,.dash .kpi{transition:box-shadow .25s ease,border-color .25s ease}
.dash .panel:hover,.dash .kpi:hover{box-shadow:0 8px 24px rgba(255,103,32,.13);border-color:var(--orange)}
.dept-card__kpi{transition:opacity .3s ease}
.dept-card__kpi.is-loading{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;font-size:.95rem;font-weight:700;color:var(--orange-deep);font-style:normal}
.dept-card__kpi.reveal{animation:fade .6s ease backwards}
.dept-card__kpi.leaving{opacity:0}
.kpi__value{transition:color .25s ease}
tbody.swap tr{animation:rowIn .35s ease backwards;animation-delay:calc(var(--r,0)*22ms)}
table.grid--pub tr.detail{animation:fade .25s ease}
.notice:not([hidden]){animation:noticeIn .28s ease}
[role="tabpanel"]:not([hidden]){animation:fade .3s ease}
.dlg[open]{animation:dlgIn .24s cubic-bezier(.2,.7,.2,1)}
.dlg[open]::backdrop{animation:fade .24s ease}
.admin-head,.auth-card{animation:fade .4s ease backwards}

/* smooth hover, focus and press on controls */
button,.btn-outline,.btn-solid,.btn-primary,.link-btn,.linkish,.badge{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .1s ease,opacity .18s ease}
button:active:not(:disabled),.btn-outline:active{transform:scale(.97)}
input,select,textarea{transition:border-color .18s ease,box-shadow .18s ease}
input:focus-visible,select:focus-visible,textarea:focus-visible{box-shadow:0 0 0 3px rgba(255,103,32,.25)}
.c2d__tip{transition:opacity .15s ease}

/* charts draw themselves (first display only; resizing does not replay it) */
.c2d--animate .c2d__grow-y{transform-box:fill-box;transform-origin:50% 100%;animation:growY .75s cubic-bezier(.2,.8,.2,1) backwards}
.c2d--animate .c2d__grow-x{transform-box:fill-box;transform-origin:0 50%;animation:growX .75s cubic-bezier(.2,.8,.2,1) backwards}
.c2d--animate .c2d__pop{transform-origin:var(--ox,50%) var(--oy,50%);animation:pop .6s cubic-bezier(.2,.8,.2,1) backwards}
.c2d--animate .c2d__line{stroke-dasharray:1;stroke-dashoffset:1;animation:drawLine 1.1s ease .1s forwards}
.c2d--animate .c2d__area{animation:fade .8s ease .5s backwards}
.c2d--animate .c2d__lbl{animation:fade .5s ease .5s backwards}

/* anyone whose device asks for less motion gets none: everything appears at once */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-delay:0ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;transition-delay:0ms!important;scroll-behavior:auto!important}
}
@media print{*,*::before,*::after{animation:none!important;transition:none!important}.card-loading{display:none!important}}

.filters__hint{font-size:.85rem;margin-left:4px}
