/* Raya — government operations system (matches the Raya desktop client) */
.raya{--maroon:#3d1220;--maroon-2:#561a2d;--accent:#561a2d;--accent-bg:#f5ece9;--bg:#f3f1ed;--surface-2:#f8f6f2;--line:#e1dbd2;--line-2:#cbc3b6;--ink:#1f1418;--muted:#685c61;--gold:#b8914a;--gold-lt:#d6b878;--ivory:#f2e6cf;
  background:var(--bg);font-size:15px}
.raya a{color:var(--accent)}
.raya .btn--primary{background:var(--maroon-2)}
.raya .btn--primary:hover{background:var(--maroon)}

/* top bar */
.top{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1rem;height:52px;padding:0 1rem;background:var(--maroon);color:var(--ivory);border-bottom:2px solid var(--gold)}
.top__brand{display:flex;align-items:center;gap:.6rem;text-decoration:none;color:#f8efdd;min-width:0;margin-inline-end:auto}
.raya .top__brand{color:#f8efdd}
.top__brand img{width:28px;height:28px;object-fit:contain}
.top__brand b{font-family:var(--font-h);font-size:1.05rem}
.top__sep{width:1px;height:16px;background:rgba(242,230,207,.3)}
.top__brand span{font-size:.82rem;color:rgba(242,230,207,.75);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top__user{display:flex;align-items:center;gap:.6rem}
.top__me{display:flex;flex-direction:column;align-items:flex-end;text-decoration:none;line-height:1.3}
.raya .top__me{color:#f8efdd}
.top__me b{font-size:.85rem}
.top__me small{font-size:.75rem;color:var(--gold-lt)}
.top__out,.top__bell,.rail-toggle{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:3px;background:transparent;color:rgba(242,230,207,.85);cursor:pointer;position:relative}
.raya .top__bell{color:rgba(242,230,207,.85)}
.top__out:hover,.top__bell:hover,.rail-toggle:hover{background:rgba(255,255,255,.1);color:#fff}
.top__cnt{position:absolute;top:2px;inset-inline-end:0;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#b42318;color:#fff;font-size:.68rem;font-weight:700;line-height:17px;text-align:center}
.rail-toggle{display:none}

/* frame */
.frame{display:grid;grid-template-columns:240px 1fr;min-height:calc(100vh - 52px)}
.side{background:#fff;border-inline-end:1px solid var(--line);display:flex;flex-direction:column;position:sticky;top:52px;height:calc(100vh - 52px);overflow-y:auto}
.side nav{padding:.6rem .6rem 1rem;flex:1}
.side__h{margin:.9rem .6rem .3rem;font-size:.72rem;font-weight:600;color:#8a7f83;letter-spacing:.02em}
.side ul{list-style:none}
.side a{position:relative;display:flex;align-items:center;gap:.6rem;padding:.5rem .7rem;border-radius:3px;color:#3a2c32;text-decoration:none;font-size:.9rem}
.side a .ic{color:var(--muted)}
.side a:hover{background:var(--surface-2);color:var(--ink)}
.side a[aria-current=page]{background:var(--accent-bg);color:var(--accent);font-weight:600}
.side a[aria-current=page] .ic{color:var(--accent)}
.side a[aria-current=page]::before{content:"";position:absolute;inset-inline-start:0;top:6px;bottom:6px;width:3px;border-radius:2px;background:var(--accent)}
.side__foot{padding:.8rem 1.1rem 1rem;border-top:1px solid var(--line);font-size:.8rem;display:flex;flex-direction:column;gap:.1rem}
.side__foot small{color:var(--muted)}
.side__foot a{padding:.3rem 0;font-size:.8rem;margin-top:.3rem}
.content{padding:1.4rem 1.6rem 1rem;min-width:0;outline:none}
.content__foot{margin-top:2rem;padding-top:1rem;border-top:1px solid var(--line);color:var(--muted);font-size:.78rem}

/* page parts */
.page-title{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;margin-bottom:1.1rem;flex-wrap:wrap}
.page-title h1{font-size:1.3rem;margin:0}
.page-title p{margin:.2rem 0 0;font-size:.85rem}
.crumbs-r{font-size:.78rem;color:var(--muted);margin-bottom:.15rem}
.crumbs-r a{color:var(--muted)}
.card__head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);margin:-1.4rem -1.4rem 1rem;padding:.75rem 1.2rem;min-height:46px}
.card__head .card__title{margin:0}
.card__head a{font-size:.82rem;font-weight:600}
.card__title{font-size:.95rem;margin-bottom:.8rem}
.raya .card{border-radius:3px;padding:1.4rem}
.cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.1rem}
.cols-3{display:grid;grid-template-columns:2fr 1fr;gap:1.1rem;align-items:start}
.narrow-card{max-width:560px}
.btn--block{width:100%;justify-content:center}
.mono{font-family:"Cascadia Mono",Consolas,ui-monospace,monospace;direction:ltr;unicode-bidi:isolate;letter-spacing:.02em}
.ua{font-size:.78rem;color:var(--muted)}

.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:.9rem;margin-bottom:1.1rem}
.kpis--3{grid-template-columns:repeat(3,1fr)}
.kpi{display:flex;flex-direction:column;gap:.2rem;padding:.9rem 1.1rem;background:#fff;border:1px solid var(--line);border-top:3px solid var(--maroon-2);text-decoration:none;color:var(--ink)}
.raya .kpi{color:var(--ink)}
.kpi span{font-size:.82rem;color:var(--muted)}
.kpi b{font-family:var(--font-h);font-size:1.7rem;line-height:1.3;color:var(--maroon-2);font-variant-numeric:tabular-nums}
.kpi--plain{border-top-color:var(--gold)}
a.kpi:hover{border-color:var(--maroon-2)}

.bars{display:grid;grid-template-columns:repeat(14,1fr);gap:4px;align-items:end;height:170px}
.bars__col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:3px}
.bars__bar{width:100%;max-width:26px;background:var(--maroon-2);border-radius:2px 2px 0 0;min-height:2px}
.bars__n{font-size:.7rem;color:var(--muted)}
.bars__d{font-size:.66rem;color:var(--muted);direction:ltr}
.bars__h0{height:2px}.bars__h1{height:10%}.bars__h2{height:20%}.bars__h3{height:30%}.bars__h4{height:40%}.bars__h5{height:50%}.bars__h6{height:60%}.bars__h7{height:68%}.bars__h8{height:76%}.bars__h9{height:84%}.bars__h10{height:90%}

.toolbar{display:flex;gap:.5rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:1rem;background:#fff;border:1px solid var(--line);padding:.8rem}
.toolbar .field{margin:0;min-width:160px;flex:1}
.toolbar .field--grow{flex:3}
.toolbar label{font-size:.78rem;margin-bottom:.15rem}
.toolbar input,.toolbar select{min-height:38px}
.seg{display:inline-flex;border:1px solid var(--line-2);border-radius:3px;overflow:hidden;margin-bottom:1rem;background:#fff}
.seg a{padding:.4rem .9rem;text-decoration:none;color:var(--ink);font-size:.85rem;border-inline-start:1px solid var(--line-2)}
.seg a:first-child{border-inline-start:0}
.seg a[aria-current=page]{background:var(--accent-bg);color:var(--accent);font-weight:600}

.raya .table th{background:var(--surface-2);font-size:.82rem;color:#3a2c32}
.raya .table td{font-size:.88rem}
.table .sub{display:block;font-size:.76rem;color:var(--muted)}

/* person header */
.person{display:grid;grid-template-columns:120px 1fr auto;gap:1.2rem;align-items:start}
.person__photo{width:120px;height:160px;object-fit:cover;border:1px solid var(--line-2);background:var(--surface-2)}
.person__nophoto{width:120px;height:160px;display:grid;place-items:center;border:1px dashed var(--line-2);color:var(--muted);font-size:.8rem;background:var(--surface-2);text-align:center}
.person h2{font-size:1.2rem;margin-bottom:.1rem}
.person .en{font-size:.85rem;color:var(--muted);direction:ltr;text-align:end;unicode-bidi:isolate}
.person .facts{margin-top:.7rem;grid-template-columns:max-content 1fr max-content 1fr}
.flag-wanted{border:1px solid #efc9c6;background:#fbeceb;color:#9a1f1f;padding:.6rem .9rem;border-radius:3px;font-weight:600;display:flex;gap:.5rem;align-items:center}
.inline-form{display:flex;gap:.5rem;align-items:flex-end;flex-wrap:wrap}
.inline-form .field{margin:0}
details.panel{border:1px solid var(--line);background:#fff;margin-bottom:1rem}
details.panel summary{cursor:pointer;padding:.7rem 1rem;font-weight:600;font-size:.9rem;list-style:none;display:flex;align-items:center;gap:.4rem}
details.panel summary::-webkit-details-marker{display:none}
details.panel[open] summary{border-bottom:1px solid var(--line)}
details.panel > div{padding:1rem}
.danger-zone{border-color:#efc9c6}

.timeline-r{list-style:none;border-inline-start:2px solid var(--line-2);margin-inline-start:.4rem}
.timeline-r li{position:relative;padding:0 1.1rem .9rem}
.timeline-r li::before{content:"";position:absolute;inset-inline-start:-6px;top:.45rem;width:10px;height:10px;border-radius:50%;background:var(--maroon-2);border:2px solid #fff}
.timeline-r .meta{font-size:.78rem;color:var(--muted)}
.timeline-r .note{background:var(--surface-2);border:1px solid var(--line);padding:.5rem .7rem;margin-top:.3rem;font-size:.88rem;white-space:pre-wrap}

.cred{background:#fff;border:2px solid var(--gold);padding:1.4rem;max-width:560px}
.cred dl{grid-template-columns:max-content 1fr}
.cred dd{font-size:1.15rem}

.notif{list-style:none;background:#fff;border:1px solid var(--line)}
.notif li{display:flex;gap:.8rem;padding:.8rem 1rem;border-bottom:1px solid var(--line)}
.notif li.unread{background:#fdf9f3}
.notif .ic{margin-top:.2rem}
.notif .k-bad{color:#9a1f1f}.notif .k-warn{color:#85560a}.notif .k-ok{color:#24603f}.notif .k-info{color:#234266}
.notif small{color:var(--muted);display:block}

/* login */
.raya--bare{background:var(--maroon)}
.bare{min-height:100vh;display:grid;place-items:center;padding:2rem 1rem}
.bare__alert{max-width:900px;width:100%}
.login{display:grid;grid-template-columns:1fr 1fr;max-width:900px;width:100%;background:#fff;border-top:3px solid var(--gold);box-shadow:0 20px 50px rgba(0,0,0,.35)}
.login__side{background:#2c0c17;color:#e8dcc6;padding:2.5rem;display:flex;flex-direction:column;align-items:flex-start;justify-content:center}
.login__side img{width:120px;height:120px;object-fit:contain;margin-bottom:1rem}
.login__side h1{color:#fff;font-size:1.6rem;margin-bottom:.4rem}
.login__note{display:flex;gap:.4rem;align-items:center;font-size:.85rem;color:var(--gold-lt);margin-top:1rem}
.login__form{padding:2.5rem}
.login__form h2{font-size:1.2rem;margin-bottom:1.2rem}
.login__help{margin-top:1rem}
.login__back{margin:1rem 0 0;font-size:.85rem}
.login__back a{display:inline-flex;gap:.3rem;align-items:center}
.pw{position:relative}
.pw input{padding-inline-end:2.6rem}
.pw__btn{position:absolute;inset-inline-end:4px;top:4px;width:34px;height:34px;border:0;background:transparent;cursor:pointer;color:var(--muted)}
.bare-card{background:#fff;max-width:620px;width:100%;padding:2rem;border-top:3px solid var(--gold)}
.bare-card__emblem{margin:0 auto 1rem}
.bare-card h1{text-align:center;font-size:1.3rem}
.bare .error-page{background:#fff;padding:3rem 2rem;max-width:620px}

/* receipt */
.receipt{background:#fff;max-width:720px;width:100%;padding:2rem 2.2rem;border:1px solid var(--line)}
.receipt__head{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid var(--maroon-2);padding-bottom:1rem;margin-bottom:1.2rem}
.receipt__head img{width:70px;height:70px}
.receipt__head b{display:block;font-family:var(--font-h);color:var(--maroon-2)}
.receipt .facts{grid-template-columns:max-content 1fr}
.receipt__ref{font-size:1.6rem;font-family:var(--font-h);text-align:center;padding:.8rem;border:1px dashed var(--line-2);margin:1rem 0;direction:ltr}

@media (max-width:1100px){
  .kpis{grid-template-columns:1fr 1fr}
  .cols,.cols-3{grid-template-columns:1fr}
  .person{grid-template-columns:100px 1fr}
  .person > :last-child{grid-column:1/-1}
}
@media (max-width:860px){
  .frame{grid-template-columns:1fr}
  .side{display:none;position:fixed;top:52px;inset-inline-start:0;width:260px;z-index:30;box-shadow:0 10px 30px rgba(0,0,0,.2)}
  .side.open{display:flex}
  .rail-toggle{display:grid}
  .top__brand span,.top__sep,.top__me small{display:none}
  .content{padding:1rem}
  .login{grid-template-columns:1fr}
  .login__side{padding:1.5rem}
  .person .facts{grid-template-columns:max-content 1fr}
}
@media print{
  .raya{background:#fff}
  .frame{display:block}
  .content{padding:0}
  .card{box-shadow:none}
  .raya--bare{background:#fff}
  .receipt{border:0}
}
.note-box{background:var(--surface-2);border:1px solid var(--line);padding:.7rem .9rem;white-space:pre-wrap;font-size:.92rem;margin:0}
.raya a.btn--primary,.raya a.btn--primary:hover,.raya a.btn--danger{color:#fff}
.raya a.btn--line{color:var(--ink)}
.raya a.btn--line:hover{color:var(--accent)}
.kpis--auto{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
