/* RPOP - additions to the CSS Portal template (app.css) */

/* ---------- Header: notification bell ---------- */
.doh-hdr .header-right{gap:12px}
.bell-wrap{position:relative}
.bell-btn{position:relative;background:rgba(255,255,255,.14);border:1.5px solid rgba(255,255,255,.28);color:#fff;width:38px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:16px;transition:background .15s}
.bell-btn:hover{background:rgba(255,255,255,.28)}
.bell-badge{position:absolute;top:-5px;right:-5px;background:#e53e3e;color:#fff;font-size:10px;font-weight:800;min-width:17px;height:17px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px;border:2px solid #fff}
.bell-badge[hidden]{display:none}
.bell-dropdown{display:none;position:absolute;top:calc(100% + 10px);right:-6px;width:370px;max-width:calc(100vw - 16px);background:#fff;border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,.18);z-index:9999;overflow:hidden;border:1px solid #e2e8f0;color:var(--doh-text)}
.bell-dropdown.open{display:block;animation:bDrop .2s ease}
@keyframes bDrop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.bell-dh{background:linear-gradient(135deg,#1e3c72,#2a5298);padding:13px 16px;display:flex;align-items:center;justify-content:space-between}
.bell-dh-title{color:#fff;font-weight:700;font-size:14px}
.bell-mark-all{background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.3);color:#fff;padding:5px 11px;border-radius:6px;font-size:12px;cursor:pointer;font-family:inherit}
.bell-mark-all:hover{background:rgba(255,255,255,.3)}
.bell-items{max-height:360px;overflow-y:auto}
.bell-item{--bc:#4285f4;--bbg:#eff6ff;display:flex;align-items:flex-start;gap:11px;padding:12px 14px;border-bottom:1px solid #f0f0f0;cursor:pointer;transition:background .15s,opacity .2s;border-left:5px solid var(--bc);background:#fff}
.bell-item:hover{background:#f8fafc}
.bell-item.busy{opacity:.5;pointer-events:none}
.bell-avatar{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:15px;flex-shrink:0;background:var(--bbg);color:var(--bc)}
.bell-body{flex:1;min-width:0}
.bell-title-row{font-size:13px;font-weight:700;color:#1e293b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bell-sub{font-size:11.5px;color:#64748b;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal}
.bell-meta{font-size:11px;color:#94a3b8;margin-top:3px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.bell-status{padding:2px 7px;border-radius:7px;font-size:10px;font-weight:900;background:var(--bbg);color:var(--bc)}
.bell-actor{font-weight:800;color:#475569}
.bell-view{margin-left:auto;font-size:10px;font-weight:800;color:var(--bc)}
.bell-dot{width:8px;height:8px;background:var(--bc);border-radius:50%;flex-shrink:0;margin-top:5px}
.bell-empty{padding:28px;text-align:center;color:#94a3b8}
.bell-empty i{font-size:28px;margin-bottom:7px;display:block;opacity:.4}
@media (max-width:700px){
  .bell-dropdown{position:fixed;top:60px;left:8px;right:8px;width:auto}
  .bell-btn{width:34px;height:34px;font-size:14px}
}

/* ---------- First login: change or keep password ---------- */
.doh-modal.pw-prompt{max-width:520px}
.pw-prompt-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:8px}
.pw-prompt-actions .inline-form{margin:0}

/* ---------- Wide pages (editors, big RPO list) ---------- */
body.wide .admin-main{padding:16px 18px 70px}
body.admin .admin-main{padding-bottom:70px}

/* ---------- RPO module pages inside the template ---------- */
.rpo-page{position:relative}
.rpo-page img{max-width:100%}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* User levels table */
.lvl-perms{margin:0;padding-left:18px}
.lvl-perms li{margin:2px 0}

@media print{
  .bell-wrap,.live-pill,#pwPrompt{display:none!important}
}

/* ---------- Small message window (same look as the login page window) ---------- */
.admin .doh-modal{background:#fff;border-radius:18px;padding:32px 30px 26px;max-width:460px;width:100%;position:relative;box-shadow:0 20px 60px rgba(0,30,80,.25);text-align:center;margin:auto}
.admin .doh-modal-icon{width:64px;height:64px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:26px;background:#dce8f8;color:#1252a3}
.admin .doh-modal-title{font-size:20px;font-weight:800;color:var(--doh-text);margin:0 0 10px}
.admin .doh-modal-body{font-size:14px;color:var(--doh-muted);line-height:1.7;margin:0 0 20px}
#pwPrompt{align-items:center}
.list-dark-btn{position:absolute;top:14px;right:14px;z-index:2;background:rgba(255,255,255,.15);border:1.5px solid rgba(255,255,255,.3);color:#fff;width:36px;height:36px;border-radius:9px;cursor:pointer}

/* Header: the bell window must show below the header (was cut off) */
.admin .doh-hdr{overflow:visible;z-index:1000}
.admin .doh-hdr .bell-dropdown{z-index:10000}

/* Public pages (RPO Library without login): the header stays on top while scrolling */
body.public .doh-hdr{position:sticky;top:0;z-index:1000;overflow:visible}
body.public .doh-hdr .header-right{gap:10px}
.bell-foot{display:flex;align-items:center;justify-content:center;gap:7px;padding:11px 14px;font-size:13px;font-weight:700;color:var(--doh-blue);text-decoration:none;background:#f8fbff;border-top:1px solid #e2e8f0}
.bell-foot:hover{background:#eef4ff;text-decoration:underline}
/* All Notifications page */
.ntf-row.unread td{background:#f4f8ff}
.ntf-row.unread .ntf-title{font-weight:800}
.ntf-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--doh-blue);margin-right:6px}
.ntf-msg{color:var(--doh-muted);font-size:13px;margin-top:2px}
html[data-theme="dark"] .ntf-row.unread td{background:#18213a}
html[data-theme="dark"] .bell-foot{background:#151823;color:#93c5fd;border-top-color:#2d3148}
/* User Levels: Role Permissions */
.perm-tbl td .muted{font-size:12px;margin-top:2px}
.perm-tbl td i.fas{color:var(--doh-blue);width:18px;text-align:center}
.perm-col{text-align:center!important;width:110px}
.perm-col i.fa-lock{color:#94a3b8!important}
.perm-fixed td{background:#f8fafc}
.perm-group td{background:var(--doh-blue-soft,#eef4ff);font-size:13px;padding-top:10px;padding-bottom:6px}
html[data-theme="dark"] .perm-group td{background:#1b2236}
.perm-chk{display:inline-flex;cursor:pointer}
.perm-chk input{width:20px;height:20px;accent-color:#1252a3;cursor:pointer}
.perm-chk span{display:none}
.perm-actions{display:flex;justify-content:flex-end;padding:14px 16px 6px}
.perm-reset{display:flex;justify-content:flex-end;padding:0 16px 14px}
html[data-theme="dark"] .perm-fixed td{background:#151823}
@media (max-width:700px){.perm-col{width:auto}}

/* Editor pages (single_rpo, rpo_hrd, rpo_transport): left menu hidden for a bigger editor; header "menu" button opens it */
body.rpo-editor .sidebar{position:fixed;left:-270px;top:0;bottom:0;z-index:1100;transition:left .2s;min-height:100vh;overflow-y:auto;box-shadow:4px 0 20px rgba(0,0,0,.18)}
body.rpo-editor .sidebar.open{left:0}
body.rpo-editor .admin-main>.sb-toggle{display:none!important}
body.rpo-editor .admin-main{width:100%;max-width:none}
/* Editor pages: the editor fills the screen between the header and the footer (no double scroll bars) */
@media (min-width:981px){
  html:has(body.rpo-editor),body.rpo-editor{overflow:hidden;height:100%}
  body.rpo-editor .admin-wrap{min-height:0}
  body.rpo-editor .admin-main{padding:0!important;margin:0!important;min-height:0}
  body.rpo-editor .admin-main>.alert{margin:8px 12px}
  body.rpo-editor .admin-main>:is(.pg-single-rpo,.pg-rpo-hrd,.pg-rpo-transport){height:calc(100vh - var(--ed-top,76px) - var(--ed-bottom,51px))!important;min-height:0!important;border-radius:0!important;border:0!important;margin:0!important}
}

/* Editor messages ("Template loaded", "Document saved"...): the editors add them to <body>, outside the
   page wrapper, so they had no style and were printed on an extra page. Small message at the top right; never printed. */
body > .notif{position:fixed;top:88px;right:16px;padding:10px 15px;border-radius:8px;color:#fff;font-weight:700;font-size:12.5px;z-index:99999;display:flex;align-items:center;gap:7px;box-shadow:0 4px 12px rgba(0,0,0,.2);max-width:calc(100vw - 32px);font-family:inherit}
body > .notif-ok{background:#28a745}
body > .notif-err{background:#dc3545}
body > .notif-info{background:#1252a3}
@media print{.notif{display:none!important}}

/* TinyMCE toolbar on the document editors (System Settings -> Document Editor) */
.tmce-bar{position:relative;z-index:6;background:#fff;border-bottom:1px solid #dadce0;min-height:42px;flex-shrink:0}
.tmce-bar .tox-tinymce-inline{position:static!important;width:100%!important;max-width:none!important;border:0!important;box-shadow:none!important;left:auto!important;top:auto!important}
.tmce-bar .tox .tox-toolbar,.tmce-bar .tox .tox-toolbar__primary,.tmce-bar .tox .tox-toolbar__overflow{background:#fff!important}
body.tmce-on #docPage:focus,body.tmce-on #docPage.mce-edit-focus{outline:none!important}
body.tmce-on .tox-tinymce-aux{z-index:100001}
html[data-theme="dark"] .tmce-bar,html[data-theme="dark"] .tmce-bar .tox .tox-toolbar,html[data-theme="dark"] .tmce-bar .tox .tox-toolbar__primary{background:#1a1d27!important;border-color:#2d3148}
@media print{.tmce-bar,.tox,.tox-tinymce-aux{display:none!important}
  body #docPage [data-mce-selected]{outline:none!important}}
.radio-row{display:flex!important;gap:8px;align-items:flex-start;font-weight:400!important;text-transform:none!important;letter-spacing:0!important;font-size:14px!important;margin:6px 0;cursor:pointer}
.radio-row input{margin-top:4px}
.tmce-bar[hidden]{display:none!important}
.speed-tbl{margin-top:14px}
/* Transfer to HRDS: Training or Clearing */
.hrdt-overlay{position:fixed;inset:0;z-index:100000;background:rgba(0,20,60,.5);display:flex;align-items:center;justify-content:center;padding:16px}
.hrdt-box{background:#fff;border-radius:14px;width:min(420px,100%);box-shadow:0 20px 60px rgba(0,0,0,.3);overflow:hidden;color:var(--doh-text)}
.hrdt-hd{display:flex;align-items:center;gap:8px;padding:13px 16px;background:linear-gradient(90deg,#0e7490,#155e75);color:#fff;font-weight:700}
.hrdt-hd span{flex:1}
.hrdt-x{background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.35);color:#fff;border-radius:8px;width:32px;height:32px;cursor:pointer}
.hrdt-bd{padding:16px}
.hrdt-bd p{margin:0 0 10px}
.hrdt-ctl{font-weight:700;color:var(--doh-blue)}
.hrdt-opt{display:flex;align-items:center;gap:10px;border:1.5px solid var(--doh-border);border-radius:10px;padding:11px 13px;margin:8px 0;cursor:pointer;font-size:15px}
.hrdt-opt:has(input:checked){border-color:#0e7490;background:#ecfeff}
.hrdt-opt input{width:18px;height:18px;accent-color:#0e7490}
.hrdt-ft{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--doh-border);background:#f8fbff}
html[data-theme="dark"] .hrdt-box{background:#1a1d27;color:#e2e8f0}
html[data-theme="dark"] .hrdt-opt{border-color:#2d3148}
html[data-theme="dark"] .hrdt-opt:has(input:checked){background:#0b3440}
html[data-theme="dark"] .hrdt-ft{background:#151823;border-color:#2d3148}
.badge.b-purple{background:#ede9fe;color:#5b21b6}
html[data-theme="dark"] .badge.b-purple{background:#2e1065;color:#ddd6fe}
/* v2: quick role change in User Accounts */
.role-quick{margin-top:6px}
.role-quick select{font-size:12px;padding:3px 6px;border:1px solid var(--doh-border,#cbd5e1);border-radius:6px;max-width:170px;background:#fff;color:inherit;cursor:pointer}
html[data-theme="dark"] .role-quick select{background:#151823;border-color:#2d3148}
/* v2: counts in the left menu (pending, returned, notifications, messages) */
.sidebar nav a .nav-count,.ntf-tab .nav-count{margin-left:auto;min-width:22px;padding:1px 7px;border-radius:999px;font-size:11px;font-weight:800;line-height:18px;text-align:center;background:#e2e8f0;color:#475569}
.nav-count.has{background:#1252a3!important;color:#fff!important}
.nav-count.nc-returned.has{background:#dc2626!important}
.nav-count.nc-messages.has{background:#ea580c!important}
.nav-count.nc-notifications.has{background:#dc2626!important}
.sidebar nav a.active .nav-count{background:#fff!important;color:#1252a3!important}
html[data-theme="dark"] .nav-count{background:#2d3148;color:#cbd5e1}
html[data-theme="dark"] .nav-count.has{background:#3b82f6;color:#fff!important}
/* v2: Notifications / Messages tabs */
.ntf-tabs{display:flex;gap:8px;margin:0 0 12px;flex-wrap:wrap}
.ntf-tab{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:10px;border:1px solid var(--doh-border,#dbe3ef);background:#fff;color:inherit;text-decoration:none;font-weight:700}
.ntf-tab.active{background:#1252a3;border-color:#1252a3;color:#fff}
.ntf-tab.active .nav-count{background:#fff;color:#1252a3}
html[data-theme="dark"] .ntf-tab{background:#1a1d27;border-color:#2d3148}
html[data-theme="dark"] .ntf-tab.active{background:#1e40af}
/* v2: two bells in the header */
.bell-wrap + .bell-wrap{margin-left:2px}
.bell-messages .bell-dh{background:linear-gradient(135deg,#c2410c,#f97316)}
/* v2: Recycle Bin */
.trash-details{display:inline-block;vertical-align:top}
.trash-details summary{list-style:none;cursor:pointer}
.trash-details summary::-webkit-details-marker{display:none}
.trash-details[open] summary{background:var(--doh-bg,#eef4ff)}
.trash-dl{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:8px 0 4px;padding:10px 12px;border:1px solid var(--doh-border,#dbe3ef);border-radius:8px;background:#f8fafc;font-size:13px;max-width:460px;text-align:left}
.trash-dl dt{font-weight:700;color:var(--doh-muted,#64748b)}
.trash-dl dd{margin:0;word-break:break-word}
html[data-theme="dark"] .trash-dl{background:#151823;border-color:#2d3148}
/* v2: Province module */
.scope-banner{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:8px 14px;border-radius:10px;background:linear-gradient(90deg,#065f46,#0f766e);color:#fff;font-size:13px}
.scope-banner span{opacity:.85;font-size:12px}
body.scope-province .doh-hdr{box-shadow:inset 0 -4px 0 #10b981}
.nav-count.nc-p_returned.has{background:#dc2626!important}
.nav-count.nc-p_messages.has{background:#ea580c!important}
.nav-count.nc-p_notifications.has{background:#dc2626!important}
html[data-theme="dark"] .scope-banner{background:linear-gradient(90deg,#064e3b,#115e59)}
