:root{--navy:#123d7a;--blue:#1f5fbf;--blue2:#eaf1fc;--ink:#172338;--muted:#718096;--line:#e5eaf1;--bg:#e8eef7;--white:#fff;--green:#18845b;--amber:#a66b08;--shadow:0 10px 30px rgba(20,48,88,.07)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}button,input,select{font:inherit}button{cursor:pointer}.hidden{display:none!important} .login-wrap{min-height:100vh;display:grid;place-items:center;padding:34px;background:linear-gradient(135deg,#e8eef6 0%,#f4f6f9 55%,#e7edf5 100%)}.login-frame{width:min(1040px,100%);min-height:620px;display:grid;grid-template-columns:1.08fr .92fr;background:#fff;border-radius:22px;overflow:hidden;box-shadow:0 28px 90px #061a3855}.login-brand-panel{position:relative;display:flex;flex-direction:column;justify-content:space-between;padding:42px 46px;color:#172f52;background:linear-gradient(145deg,#f7f8fa 0%,#edf2f7 100%);overflow:hidden}.login-brand-panel:after{content:"";position:absolute;width:440px;height:440px;border:1px solid #ef7b4530;border-radius:50%;right:-180px;bottom:-190px;box-shadow:0 0 0 38px #ef7b4510,0 0 0 82px #1f5fbf08}.login-brand-logo{position:relative;z-index:1;background:#fff;border:1px solid #e0e6ee;border-left:5px solid #ef7b45;border-radius:12px;padding:15px 20px;width:min(100%,480px);display:flex;align-items:center;min-height:112px;box-shadow:0 8px 22px rgba(20,48,88,.06)}.login-brand-logo img{display:block;width:100%;height:auto;max-height:82px;object-fit:contain}.login-brand-copy{position:relative;z-index:1;max-width:450px;margin:55px 0}.login-kicker{font-size:10px;letter-spacing:2px;font-weight:800;color:#d95f2c;margin:0 0 18px}.login-brand-copy h1{font-size:clamp(32px,4vw,48px);line-height:1.12;letter-spacing:-1.5px;margin:0 0 20px;color:#12345b}.login-brand-copy p:last-child{font-size:14px;line-height:1.8;color:#586b83;max-width:390px}.login-brand-bottom{position:relative;z-index:1;color:#60748d;font-size:11px}.brand-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#ef7b45;margin-right:8px}.login-card{width:auto;align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding:58px clamp(32px,5vw,66px);border-radius:0;box-shadow:none}.login-mobile-logo{display:none}.login-card .eyebrow{font-size:10px;font-weight:800;letter-spacing:1.6px;color:#e87543;margin:0 0 10px}.login-card h2{font-size:27px;line-height:1.2;letter-spacing:-.7px;margin:0 0 9px;color:#172338}.login-intro{font-size:13px;color:var(--muted);margin:0}.login-card form{display:grid;gap:9px;margin-top:30px}.login-card label{font-size:12px;font-weight:700;margin-top:8px;color:#34445b}.login-card input,.toolbar input,.toolbar select,.search-large input{width:100%;border:1px solid var(--line);border-radius:9px;padding:13px;background:#fff;outline:none}.login-card input:focus,.toolbar input:focus,.toolbar select:focus,.search-large input:focus{border-color:var(--blue);box-shadow:0 0 0 3px #1f5fbf18}.primary-btn{background:var(--blue);color:#fff;border:0;border-radius:9px;padding:12px 17px;font-weight:700;transition:background .15s,transform .15s}.primary-btn:hover{background:var(--navy);transform:translateY(-1px)}.full{width:100%;margin-top:14px;padding:14px;display:flex;justify-content:center;gap:12px;align-items:center}.message{font-size:12px;color:var(--green);min-height:18px;margin:12px 0 0}.message.error{color:#b42318}.login-security{display:flex;align-items:center;gap:12px;padding:14px;background:#f5f8fc;border:1px solid #e8edf5;border-radius:10px;margin-top:22px;color:#24518c}.login-security>span{font-size:22px}.login-security b,.login-security small{display:block}.login-security b{font-size:11px}.login-security small{font-size:10px;color:var(--muted);margin-top:2px}.login-foot{border-top:1px solid var(--line);padding-top:17px;margin:25px 0 0;color:var(--muted);font-size:10px}.side-brand{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:4px 7px 27px}.side-logo{background:#fff;border-radius:8px;padding:8px 9px;min-height:51px;display:flex;align-items:center;justify-content:center}.side-logo img{display:block;width:100%;height:auto;max-height:42px;object-fit:contain}.side-brand-caption{padding-left:2px}.side-brand strong{display:block;color:white;font-size:13px}.side-brand span{display:block;color:#9db5d5;font-size:10px}
.app-shell{min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:248px;background:#102f60;color:#dbe7f8;padding:22px 15px;display:flex;flex-direction:column;z-index:5}.side-brand{display:flex;align-items:center;gap:11px;padding:0 8px 29px}.side-brand strong{display:block;color:white;font-size:14px}.side-brand span{display:block;color:#9db5d5;font-size:11px}.site-label{font-size:9px;font-weight:800;letter-spacing:1.5px;color:#8fa8ca;padding:8px 12px 10px}.nav-item{display:flex;align-items:center;gap:12px;width:100%;border:0;background:transparent;color:#c4d3e8;padding:11px 13px;border-radius:8px;text-align:left;margin:2px 0;font-size:13px}.nav-item span{font-size:17px;width:18px;text-align:center}.nav-item:hover,.nav-item.active{background:#ffffff18;color:white}.nav-item.active{box-shadow:inset 3px 0 #70aaff}.nav-item i{font-style:normal;margin-left:auto;font-size:10px}.nav-section{margin-top:24px}.sidebar-bottom{margin-top:auto;padding:15px 10px 4px;color:#9db5d5;font-size:10px}.secure-pill{color:#d5e8df;margin-bottom:9px}.secure-pill span{display:inline-block;width:7px;height:7px;background:#44c18a;border-radius:50%;margin-right:7px}.main-area{margin-left:248px;min-height:100vh}.topbar{height:70px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 34px;position:sticky;top:0;z-index:4}.breadcrumb{color:var(--muted);font-size:12px}.breadcrumb span{padding:0 9px;color:#b8c2d0}.breadcrumb b{color:var(--ink)}.top-actions{display:flex;align-items:center;gap:18px}.icon-btn,.text-btn,.link-btn{border:0;background:transparent;color:var(--blue);font-weight:700}.icon-btn{font-size:20px}.user-chip{display:flex;align-items:center;gap:9px}.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--blue2);color:var(--blue);font-weight:800}.user-chip strong,.user-chip small{display:block}.user-chip strong{font-size:12px}.user-chip small{font-size:10px;color:var(--muted)}.text-btn{font-size:12px}.content{padding:30px 34px;max-width:1600px;margin:auto}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:24px}.page-heading h1{font-size:27px;letter-spacing:-.7px;margin:0 0 5px}.date-chip{background:#fff;border:1px solid var(--line);border-radius:8px;padding:8px 12px;color:var(--muted);font-size:11px}.stats-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}.stat-card,.panel{background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}.stat-card{padding:17px 18px}.stat-top{display:flex;align-items:center;justify-content:space-between;color:#526176;font-size:11px;font-weight:700}.stat-card>strong{display:block;font-size:29px;letter-spacing:-1px;margin:11px 0 2px}.stat-card>small{font-size:10px;color:var(--muted)}.stat-icon{width:29px;height:29px;border-radius:8px;display:grid;place-items:center;font-size:15px}.blue{background:#e9f1ff;color:#2864b7}.green{background:#e5f6ef;color:#16845a}.amber{background:#fff4df;color:#a66b08}.violet{background:#f0eaff;color:#7046b7}.grey{background:#edf0f4;color:#687487}.dashboard-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:16px;margin-bottom:17px}.panel{padding:20px;margin-bottom:17px}.panel-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}.panel-heading h2,.settings-panel h2{font-size:15px;margin:0 0 3px}.panel-heading .muted{font-size:11px}.link-btn{font-size:11px}.category-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}.category-card{min-height:145px;border:1px solid var(--line);border-radius:10px;background:#fff;text-align:left;padding:15px;display:flex;flex-direction:column;align-items:flex-start;transition:.15s}.category-card:hover{border-color:#9bb9e8;background:#f8fbff;transform:translateY(-2px)}.category-icon{width:33px;height:33px;border-radius:9px;background:var(--blue2);color:var(--blue);display:grid;place-items:center;font-size:18px;margin-bottom:12px}.category-card b{font-size:12px}.category-card small{font-size:10px;color:var(--muted);margin-top:5px}.action-row{width:100%;display:flex;align-items:center;gap:12px;padding:13px 2px;border:0;border-bottom:1px solid var(--line);background:white;text-align:left}.action-row:last-child{border:0}.action-row>span{width:34px;height:34px;border-radius:9px;background:var(--blue2);color:var(--blue);display:grid;place-items:center;font-size:17px}.action-row div{flex:1}.action-row b,.action-row small{display:block}.action-row b{font-size:12px}.action-row small{font-size:10px;color:var(--muted)}.action-row em{font-style:normal;color:var(--muted)}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:650px;text-align:left}th{font-size:10px;text-transform:uppercase;letter-spacing:.6px;color:#77859a;background:#f8fafc;padding:11px 12px;border-bottom:1px solid var(--line)}td{padding:12px;border-bottom:1px solid #edf0f5;font-size:11px;color:#536176}td b{display:block;color:#1d2b40;font-size:11px}td small{display:block;color:#8a96a8;font-size:10px;margin-top:3px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status-pill{display:inline-block;border-radius:20px;padding:4px 8px;background:#eef2f7;color:#58677d;font-size:10px;text-transform:capitalize}.empty-state{padding:28px;text-align:center;color:var(--muted);font-size:12px}.toolbar{display:flex;gap:12px;margin-bottom:16px}.toolbar input{max-width:440px}.toolbar select{max-width:220px}.search-large{display:flex;align-items:center;gap:10px;margin-bottom:16px}.search-large>span{font-size:23px;color:var(--blue)}.search-large input{flex:1}.notice{background:#fff8e8;border:1px solid #f0d79b;color:#79520c;border-radius:9px;padding:12px 15px;margin-bottom:18px;font-size:12px}.settings-panel{max-width:700px}.small-note{font-size:11px;margin-top:12px}footer{padding:15px 0 4px;color:#98a3b3;font-size:10px}footer span{padding:0 5px}.mobile-brand{display:none}
@media(max-width:1100px){.login-frame{max-width:900px}.login-brand-panel{padding:34px}.login-card{padding:42px 34px}.stats-grid{grid-template-columns:repeat(3,1fr)}.dashboard-grid{grid-template-columns:1fr}.sidebar{width:220px}.main-area{margin-left:220px}.content{padding:25px 22px}.topbar{padding:0 22px}}
@media(max-width:700px){.login-wrap{padding:14px;align-items:start}.login-frame{grid-template-columns:1fr;min-height:0;border-radius:16px}.login-brand-panel{display:none}.login-card{padding:30px 24px}.login-mobile-logo{display:block;background:#fff;border:1px solid var(--line);border-radius:8px;padding:9px 12px;margin-bottom:27px}.login-mobile-logo img{display:block;width:100%;max-height:55px;object-fit:contain}.login-card h2{font-size:24px}.sidebar{width:64px;padding:17px 8px}.side-brand{padding:0 3px 25px}.side-brand-caption,.site-label,.nav-item:not(.active){font-size:0}.side-logo{padding:5px 2px;min-height:38px}.side-logo img{max-height:25px}.nav-item{justify-content:center;padding:12px 5px}.nav-item span{font-size:18px}.nav-item.active{font-size:0}.nav-item i{display:none}.sidebar-bottom{display:none}.main-area{margin-left:64px}.topbar{height:60px;padding:0 13px}.breadcrumb{display:none}.mobile-brand{display:block;font-weight:800;color:var(--navy)}.top-actions{gap:9px}.user-chip>div:last-child,.text-btn{display:none}.content{padding:22px 13px}.stats-grid{grid-template-columns:repeat(2,1fr);gap:9px}.stat-card{padding:13px}.stat-card>strong{font-size:24px}.category-grid{grid-template-columns:1fr}.category-card{min-height:105px}.page-heading h1{font-size:23px}.date-chip{display:none}.panel{padding:15px}.toolbar{flex-direction:column}.toolbar input,.toolbar select{max-width:none}.search-large{flex-wrap:wrap}.search-large input{min-width:0}.login-card{padding:30px 24px}}

/* R3 portal-style visual refresh */
:root{--navy:#173b5a;--blue:#1678ad;--blue2:#eaf4f9;--ink:#20313e;--muted:#687b88;--line:#dce5ea;--bg:#f7f9fa;--shadow:0 8px 24px rgba(31,57,73,.06)}
.login-wrap{min-height:100vh;background:#fff;display:flex;justify-content:center;align-items:flex-start;padding:62px 20px 36px}
.portal-login{width:min(100%,500px);text-align:center;color:#263b49;padding:8px 26px 24px}
.portal-logo{width:100%;display:flex;justify-content:center;align-items:center;margin:0 auto 24px}
.portal-logo img{display:block;width:min(100%,390px);height:112px;object-fit:contain}
.portal-login h1{font-size:34px;line-height:1.2;font-weight:600;letter-spacing:-.5px;margin:0 0 6px;color:#263b49}
.portal-subtitle{margin:0;color:#72818b;font-size:13px}
.portal-rule{height:1px;background:#e5eaed;margin:20px 0 21px}
.portal-form{display:flex;flex-direction:column;gap:14px;text-align:left}
.portal-field{display:grid;grid-template-columns:105px 1fr;gap:12px;align-items:center}
.portal-field label{font-size:13px;font-weight:600;color:#334955}
.portal-field input{width:100%;height:43px;border:1px solid #cbd5db;border-radius:4px;padding:0 13px;background:#fff;color:#263b49;outline:none}
.portal-field input:focus{border-color:#2487b5;box-shadow:0 0 0 3px #1684b51a}
.portal-submit{align-self:flex-end;width:calc(100% - 117px);height:42px;border-radius:4px;background:#1678ad;margin-top:1px}
.portal-submit:hover{background:#12658f}
.portal-help{font-size:12px;color:#657782;margin:23px 0 14px}
.login-foot{border-top:1px solid #e7ecef;padding-top:14px;margin:0;color:#84919a;font-size:11px}
#login-message:empty{display:none}
#login-message{margin:12px 0 0}
.sidebar{background:#fff;border-right:1px solid var(--line);color:#344b59;padding:20px 14px}
.side-brand{border-bottom:1px solid var(--line);padding:0 4px 17px;margin-bottom:18px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.side-logo{width:100%;height:62px;padding:0;background:#fff;border:0;border-radius:0;display:flex;align-items:center}
.side-logo img{width:100%;max-height:58px;object-fit:contain}
.side-brand-caption strong{color:#203b4c;font-size:14px}
.side-brand-caption span{color:#788994}
.site-label{color:#8b9aa3;font-size:10px;letter-spacing:1.1px}
.nav-item{color:#415866;border-radius:5px;margin:3px 0;padding:11px 12px}
.nav-item:hover{background:#f0f6f9;color:#126f9f}
.nav-item.active{background:#eaf3f8;color:#126f9f;box-shadow:inset 3px 0 #1678ad}
.sidebar-bottom{color:#82919a}
.secure-pill{color:#35634f}
.main-area{background:#f7f9fa}
.topbar{border-bottom:1px solid #e2e9ed;box-shadow:0 2px 8px rgba(28,55,72,.025)}
.mobile-brand{color:#24475d}
.stat-card,.panel{border-radius:7px;box-shadow:0 3px 12px rgba(31,57,73,.035)}
.stat-card{border-top:3px solid #d8e8ef}
.stat-card>strong{color:#203b4c}
.category-card{border-radius:6px}
.primary-btn{background:#1678ad}
@media(max-width:700px){.login-wrap{padding:34px 14px}.portal-login{padding:8px 10px 20px}.portal-logo img{height:90px;width:min(100%,330px)}.portal-login h1{font-size:27px}.portal-field{grid-template-columns:1fr;gap:5px}.portal-submit{width:100%;align-self:stretch}.side-logo{height:42px}.side-logo img{max-height:38px}}

/* R4 document upload and revision controls */
.edms-form{margin-top:8px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700;color:#425967}.form-grid label.wide{grid-column:1/-1}.form-grid input,.form-grid select,.form-grid textarea{width:100%;min-height:39px;border:1px solid #cbd5db;border-radius:5px;padding:9px 11px;background:#fff;color:#263b49;font:inherit;font-weight:400}.form-grid textarea{resize:vertical}.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}.secondary-btn{border:1px solid #cbd5db;background:#fff;color:#415866;border-radius:5px;padding:10px 17px;font-weight:700}.primary-btn:disabled{opacity:.6;cursor:wait}.form-message{font-size:12px;color:#28664a;margin:10px 0}.form-message.error{color:#b42318}.row-actions{white-space:nowrap}.table-action{border:1px solid #d5e1e8;background:#fff;color:#176f9d;border-radius:4px;padding:6px 8px;font-size:10px;font-weight:700;margin:2px;cursor:pointer}.table-action:hover{background:#edf6fa}.table-action:disabled{opacity:.5;cursor:wait}
@media(max-width:700px){.form-grid{grid-template-columns:1fr}.form-grid label.wide{grid-column:auto}.form-actions{flex-direction:column}.form-actions button{width:100%}}


/* Document title click-through and inline preview – keeps the established R4 portal styling */
.document-title-link{display:block;padding:0;border:0;background:transparent;color:#176f9d;font:inherit;font-size:11px;font-weight:700;text-align:left;cursor:pointer;text-decoration:none}
.document-title-link:hover{color:#123d7a;text-decoration:underline}
.document-preview-wrap{margin:4px 0 24px;padding:15px;border:1px solid var(--line);border-radius:7px;background:#fbfcfe}
.document-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.document-preview-heading h3,.version-heading h3{font-size:14px;margin:0 0 3px;color:var(--ink)}
.document-preview-heading p{font-size:11px;margin:0}
.document-preview-frame{min-height:180px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:5px;background:#f1f4f8;overflow:hidden}
.document-pdf-viewer{display:block;width:100%;height:680px;border:0;background:#fff}
.document-image-viewer{display:block;max-width:100%;max-height:680px;object-fit:contain;background:#fff}
.preview-fallback{padding:35px 20px;text-align:center;max-width:480px}
.preview-file-icon{font-size:38px;color:var(--blue);margin-bottom:10px}
.preview-fallback b{display:block;font-size:13px}
.preview-fallback p{font-size:11px}
.version-heading{margin:10px 0 10px}
@media(max-width:700px){.document-preview-heading{align-items:flex-start;flex-direction:column}.document-pdf-viewer{height:520px}}

/* Employee self-registration and administrator approval – R4 visual language */
.register-link{border:0;background:transparent;color:#1678ad;font-size:12px;font-weight:700;text-decoration:underline;cursor:pointer;margin:8px auto 0;display:block}
.register-heading{font-size:20px;margin:0;color:#263b49;text-align:left}
.register-note{font-size:11px;text-align:left;margin:0 0 4px;color:#71818a}
#register-form{margin-top:16px}
#register-form .portal-field{margin:0}
#register-form .portal-submit{margin-top:8px}
.users-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}
.user-stat{padding:14px 16px;border:1px solid var(--line);border-radius:6px;background:#f8fafc}
.user-stat small,.user-stat b{display:block}.user-stat small{font-size:11px;color:var(--muted)}.user-stat b{font-size:23px;color:var(--navy);margin-top:4px}.user-stat.pending{border-left:3px solid #d99a27}.user-stat.active{border-left:3px solid #23966b}
@media(max-width:700px){.users-summary{grid-template-columns:1fr}}

/* Employee management enhancements – retain original KHTI R4 visual style */
.employee-toolbar{align-items:center;flex-wrap:wrap}.employee-toolbar input{flex:1;min-width:230px}.employee-toolbar select{min-width:180px}.user-stat.suspended{border-left:3px solid #c45c5c}.employee-edit-panel{scroll-margin-top:90px}.employee-edit-panel .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.employee-edit-panel label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700;color:#536176}.employee-edit-panel input,.employee-edit-panel select{width:100%;min-height:39px;border:1px solid var(--line);border-radius:6px;padding:9px 11px;background:#fff;color:var(--ink);font:inherit}.employee-edit-panel input:disabled{background:#f3f5f8;color:#78869a}.row-actions{white-space:nowrap}.row-actions .table-action{margin:2px 4px 2px 0}.form-message{font-size:11px;color:#a33;margin:10px 0}.form-message:empty{display:none}@media(max-width:700px){.employee-edit-panel .form-grid{grid-template-columns:1fr}.employee-toolbar select{max-width:none;width:100%}}


/* --- KHTI icon refresh: crisp line icons with restrained blue interaction --- */
.ui-icon{width:19px;height:19px;display:inline-block;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle;transition:transform .22s ease,color .22s ease,filter .22s ease}
.nav-item{gap:12px;transition:background .2s ease,color .2s ease,transform .2s ease}
.nav-item .nav-icon{width:18px;height:18px;color:#66809e}
.nav-item:hover{transform:translateX(2px)}
.nav-item:hover .nav-icon,.nav-item.active .nav-icon{color:var(--blue)}
.nav-item.active .nav-icon{filter:drop-shadow(0 2px 3px rgba(31,95,191,.18))}
.icon-btn .ui-icon{width:19px;height:19px}
.icon-btn:hover .ui-icon{transform:rotate(35deg)}
.stat-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;font-size:0;transition:transform .22s ease,box-shadow .22s ease}
.stat-icon .ui-icon{width:21px;height:21px;stroke-width:1.9}
.stat-card{position:relative;overflow:hidden;transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease}
.stat-card:hover{transform:translateY(-3px);box-shadow:0 14px 28px rgba(20,48,88,.11);border-color:#cbd9ed}
.stat-card:hover .stat-icon{transform:scale(1.08) rotate(-4deg);box-shadow:0 5px 12px rgba(25,70,130,.12)}
.category-icon{width:42px;height:42px;border-radius:13px;margin-bottom:13px;transition:transform .22s ease,background .22s ease,box-shadow .22s ease}
.category-icon .ui-icon{width:22px;height:22px;stroke-width:1.9}
.category-card{transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease}
.category-card:hover{transform:translateY(-3px);border-color:#b8cce8;box-shadow:0 10px 22px rgba(20,48,88,.08)}
.category-card:hover .category-icon{transform:scale(1.08);background:#dce9fb;box-shadow:0 4px 10px rgba(31,95,191,.12)}
.action-row{transition:background .2s ease,transform .2s ease}
.action-row> .action-icon{width:36px;height:36px;display:grid;place-items:center;flex:0 0 auto;border-radius:11px;background:#edf3fc;color:var(--blue);transition:transform .22s ease,background .22s ease}
.action-row> .action-icon .ui-icon{width:19px;height:19px}
.action-row:hover{transform:translateX(3px);background:#f7faff}
.action-row:hover>.action-icon{transform:scale(1.08);background:#dce9fb}
@media (prefers-reduced-motion:reduce){.ui-icon,.nav-item,.stat-card,.stat-icon,.category-card,.category-icon,.action-row{transition:none!important}}

/* R7.1 fix: restore icon holders and render clean outlined glyphs */
.stat-icon,.category-icon{display:inline-grid;place-items:center;line-height:1}
.stat-icon .ui-icon,.category-icon .ui-icon{display:block;fill:none!important;stroke:currentColor!important;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.stat-icon.blue{color:#2868c7;background:#e8f0ff}
.stat-icon.green{color:#15966b;background:#e5f6ef}
.stat-icon.amber{color:#b7791f;background:#fff3df}
.stat-icon.violet{color:#7653c6;background:#f0eaff}
.stat-icon.grey{color:#64748b;background:#edf1f5}
.category-icon{color:#245da8;background:#eaf2fc}
.category-icon .ui-icon{width:22px;height:22px}

/* Document expiry monitoring dashboard */
.stats-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
.stat-icon.red{background:#fdebed;color:#c43d4b}
.expiry-stat-card{border-color:#f0d7da}
.expiry-panel{margin-bottom:17px}
.expiry-summary{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.expiry-summary-item{display:inline-flex;align-items:center;gap:5px;padding:7px 10px;border-radius:20px;font-size:10px;color:#526176;background:#f2f5f9}
.expiry-summary-item b{font-size:12px}
.expiry-summary-item.due-soon{background:#fff5e5;color:#9b650e}
.expiry-summary-item.expired{background:#fdebed;color:#b73543}
.expiry-table{width:100%;border-collapse:collapse}
.expiry-table th,.expiry-table td{padding:12px 13px;text-align:left;border-bottom:1px solid var(--line);font-size:11px}
.expiry-table th{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:#6a7b91;background:#f7f9fc}
.expiry-table tr:last-child td{border-bottom:0}
.expiry-table td small{display:block;margin-top:3px;color:var(--muted);font-size:9px}
.expiry-days{font-size:11px}
.expiry-days.valid{color:#16845a}
.expiry-days.due-soon{color:#a66b08}
.expiry-days.due-today{color:#c07813}
.expiry-days.expired{color:#bd3442}
.expiry-badge{display:inline-block;padding:5px 9px;border-radius:20px;font-size:9px;font-weight:700;white-space:nowrap}
.expiry-badge.valid{background:#e5f6ef;color:#16845a}
.expiry-badge.due-soon{background:#fff4df;color:#9b650e}
.expiry-badge.due-today{background:#fff0df;color:#b66b0d}
.expiry-badge.expired{background:#fdebed;color:#b73543}
@media(max-width:1300px){.stats-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.expiry-panel .panel-heading{align-items:flex-start;flex-direction:column}.expiry-summary{justify-content:flex-start}.expiry-table{min-width:580px}}

/* R9: Malaysian date format and admin-controlled renewal workflow */
.expiry-table th:nth-child(5),.expiry-table td:nth-child(5){min-width:205px}
.expiry-status-select{width:100%;max-width:235px;padding:8px 28px 8px 10px;border:1px solid #cbd8e7;border-radius:7px;background:#fff;color:#193b60;font:inherit;font-size:10px;cursor:pointer}
.expiry-status-select:focus{outline:2px solid #9fc4ef;outline-offset:1px}
.expiry-workflow-pill{display:inline-block;padding:6px 9px;border-radius:16px;font-size:9px;font-weight:700;background:#e8f0ff;color:#245da8}
.expiry-workflow-pill.renewal-application-submitted{background:#e9edff;color:#4558a8}
.expiry-workflow-pill.pending-verification{background:#fff3df;color:#9b650e}
.expiry-workflow-pill.testing-in-progress{background:#e8f2ff;color:#2563a6}
.expiry-workflow-pill.valid{background:#e5f6ef;color:#16845a}
@media(max-width:900px){.expiry-table{min-width:900px}}

/* Administrator-managed employee folder permissions */
.folder-access-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0}
.folder-access-toolbar input{max-width:320px}
.folder-access-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:420px;overflow:auto;padding:2px}
.folder-access-item{display:flex;align-items:flex-start;gap:10px;border:1px solid var(--line,#d8e2ec);border-radius:10px;padding:12px;background:#fff;cursor:pointer}
.folder-access-item:hover{border-color:#2b78bd;background:#f6faff}
.folder-access-item input{margin-top:3px;accent-color:#1678b8}
.folder-access-item span{display:flex;flex-direction:column;gap:4px}
.folder-access-item small{color:var(--muted,#64748b);font-size:12px}
@media(max-width:760px){.folder-access-toolbar{align-items:stretch;flex-direction:column}.folder-access-toolbar input{max-width:none}.folder-access-list{grid-template-columns:1fr}}

/* Admin-only permanent document removal */
.danger-action{color:#b42318;border-color:#f0c7c4}.danger-action:hover{background:#fff1f0;color:#912018}


/* R11.2 Responsive desktop, tablet and mobile layout */
.mobile-menu-toggle,.mobile-nav-backdrop{display:none}
html{scroll-behavior:smooth}
body{overflow-x:hidden}
img,svg{max-width:100%}
button,input,select,textarea{touch-action:manipulation}
.table-wrap,.expiry-panel .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.panel,.stat-card,.dashboard-grid>*{min-width:0}
.form-grid label{min-width:0}
.form-grid input,.form-grid select,.form-grid textarea{max-width:100%}
.topbar{gap:12px}
.breadcrumb{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-actions{min-width:0}
.user-chip{min-width:0}
.user-chip>div:last-child{min-width:0}
.user-chip strong,.user-chip small{display:block;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media (min-width:761px) and (max-width:1100px){
  .sidebar{width:218px}
  .main-area{margin-left:218px}
  .content{padding:24px 20px}
  .topbar{padding:0 20px}
  .stats-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboard-grid{grid-template-columns:1fr}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .page-heading{gap:16px}
  .page-heading h1{font-size:25px}
  .folder-access-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:760px){
  .sidebar{width:min( min(82vw,310px), 310px );padding:18px 14px;transform:translateX(-105%);transition:transform .22s ease;z-index:30;box-shadow:12px 0 35px rgba(10,35,65,.18);overflow-y:auto}
  body.mobile-nav-open .sidebar{transform:translateX(0)}
  .side-brand{padding:0 8px 22px}
  .side-brand-caption{display:block}
  .site-label{font-size:9px}
  .nav-item,.nav-item:not(.active){font-size:13px;justify-content:flex-start;padding:12px 13px}
  .nav-item span{font-size:17px}
  .nav-item.active{font-size:13px}
  .nav-item i{display:block}
  .sidebar-bottom{display:block}
  .mobile-nav-backdrop{display:block;position:fixed;inset:0;background:rgba(12,28,48,.42);border:0;padding:0;opacity:0;visibility:hidden;z-index:25;transition:opacity .2s ease}
  body.mobile-nav-open .mobile-nav-backdrop{opacity:1;visibility:visible}
  .main-area{margin-left:0}
  .topbar{height:60px;padding:0 12px;gap:9px}
  .mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--navy);font-size:20px}
  .mobile-brand{display:block;flex:1;min-width:0;font-size:14px;font-weight:800;color:var(--navy)}
  .breadcrumb{display:none}
  .top-actions{gap:8px}
  .top-actions .icon-btn{font-size:18px;padding:6px}
  .user-chip{gap:6px}
  .avatar{width:31px;height:31px}
  .user-chip>div:last-child{display:none}
  .text-btn{display:none}
  .content{padding:18px 12px 28px}
  .page-heading{align-items:flex-start;flex-direction:column;gap:10px;margin-bottom:17px}
  .page-heading h1{font-size:22px}
  .page-heading .primary-btn{width:100%}
  .date-chip{display:none}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .stat-card{padding:12px}
  .stat-card>strong{font-size:23px}
  .stat-top{gap:6px;font-size:10px}
  .stat-icon{width:30px;height:30px}
  .dashboard-grid{grid-template-columns:1fr;gap:12px}
  .category-grid{grid-template-columns:1fr}
  .panel{padding:13px;border-radius:10px}
  .panel-heading{gap:10px;align-items:flex-start;flex-wrap:wrap}
  .toolbar{display:flex;flex-direction:column;align-items:stretch;gap:9px}
  .toolbar input,.toolbar select{width:100%;max-width:none;min-width:0}
  .form-grid{grid-template-columns:1fr;gap:12px}
  .form-grid label.wide{grid-column:auto}
  .form-actions{flex-direction:column-reverse}
  .form-actions button{width:100%}
  .search-large{display:flex;flex-wrap:wrap;gap:8px}
  .search-large input{width:100%;min-width:0;flex:1 1 100%}
  .search-large button{width:100%}
  .folder-access-toolbar{align-items:stretch;flex-direction:column}
  .folder-access-toolbar input{max-width:none;width:100%}
  .folder-access-list{grid-template-columns:1fr;max-height:50vh}
  .expiry-summary{justify-content:flex-start}
  .expiry-table{min-width:900px}
  .expiry-table th,.expiry-table td{padding:9px 10px}
  .document-detail-grid,.detail-grid{grid-template-columns:1fr}
  footer{padding:18px 8px;text-align:center;font-size:10px}
  .portal-login{padding:8px 10px 24px}
  .portal-logo img{height:auto;max-height:92px}
  .portal-login h1{font-size:27px}
  input,select,textarea{font-size:16px!important}
}

@media (max-width:390px){
  .content{padding-left:9px;padding-right:9px}
  .stats-grid{gap:7px}
  .stat-card{padding:10px}
  .stat-card>strong{font-size:21px}
  .topbar{padding:0 8px}
  .mobile-brand{font-size:13px}
  .panel{padding:11px}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .sidebar,.mobile-nav-backdrop{transition:none}
}

/* R11.3 persistent Home shortcut and responsive mobile navigation controls */
.home-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--blue);padding:8px 11px;font:inherit;font-size:11px;font-weight:700;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.home-btn .ui-icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.home-btn:hover{background:var(--blue2);border-color:#b8cde0;transform:translateY(-1px)}
.home-btn:focus-visible{outline:2px solid #75a9df;outline-offset:2px}
.mobile-menu-toggle,.mobile-nav-backdrop{display:none}
@media(max-width:760px){
 .home-btn{width:36px;height:36px;padding:0;gap:0;border-radius:9px}
 .home-btn span{display:none}
 .mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--navy);font-size:20px}
 .mobile-nav-backdrop{display:block;position:fixed;inset:0;background:rgba(12,28,48,.42);border:0;padding:0;opacity:0;visibility:hidden;z-index:25}
 body.mobile-nav-open .mobile-nav-backdrop{opacity:1;visibility:visible}
}


/* R11.3 persistent Home shortcut */
.home-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--blue);font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer}
.home-btn .ui-icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.home-btn:hover{background:var(--blue2);border-color:#b9d5e8}
@media(max-width:760px){.home-btn{padding:8px 9px;gap:5px;font-size:11px}.home-btn .ui-icon{width:16px;height:16px}.top-actions{gap:6px}}
@media(max-width:370px){.home-btn span{display:none}.home-btn{width:35px;height:35px;padding:7px}}


/* R11.4: keep Sign out accessible in the mobile top bar */
@media(max-width:760px){
  #signout-btn{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    white-space:nowrap;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    color:var(--blue);
    padding:8px 9px;
    font-size:10px;
    line-height:1;
    font-weight:700;
  }
  #signout-btn:active{background:var(--blue2)}
}
@media(max-width:370px){
  #signout-btn{padding:7px 7px;font-size:9px}
}

/* R11.5: manually entered certification renewal / admin status */
.expiry-manual-status{display:flex;align-items:center;gap:6px;min-width:250px}
.expiry-status-input{width:100%;min-width:150px;max-width:260px;padding:8px 9px;border:1px solid #cbd8e7;border-radius:7px;background:#fff;color:#193b60;font:inherit;font-size:10px}
.expiry-status-input:focus{outline:2px solid #9fc4ef;outline-offset:1px}
.expiry-status-save{flex:0 0 auto;border:1px solid #cbd8e7;border-radius:7px;background:#f7faff;color:#245da8;padding:8px 10px;font:inherit;font-size:10px;font-weight:700;cursor:pointer}
.expiry-status-save:hover{background:#eaf2fc}
.expiry-status-save:disabled,.expiry-status-input:disabled{opacity:.6;cursor:wait}

/* R11.6 – persistent top navigation document search */
.top-document-search{display:flex;align-items:center;gap:8px;flex:1;max-width:460px;min-width:180px;margin:0 22px;padding:5px 6px 5px 11px;background:#f7fafc;border:1px solid #dce5ea;border-radius:8px}
.top-document-search .ui-icon{width:17px;height:17px;flex:0 0 auto;stroke:#718394;fill:none;stroke-width:1.8}
.top-document-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12px}
.top-document-search input::placeholder{color:#8796a2}
.top-document-search button{flex:0 0 auto;border:0;border-radius:6px;background:var(--blue);color:#fff;padding:8px 13px;font-size:11px;font-weight:700;cursor:pointer}
.top-document-search button:hover{background:var(--navy)}
.search-result-count{margin:0 0 12px;color:var(--muted);font-size:12px}
.document-title-link{border:0;background:transparent;padding:0;color:var(--blue);font:inherit;font-weight:700;text-align:left;cursor:pointer}
.document-title-link:hover{text-decoration:underline;color:var(--navy)}
@media(max-width:1100px){.top-document-search{max-width:340px;margin:0 12px}}
@media(max-width:700px){
  .topbar{gap:8px}
  .top-document-search{margin:0 6px;min-width:0;flex:1;padding:4px 5px 4px 8px}
  .top-document-search input{font-size:11px}
  .top-document-search input::placeholder{content:"Search documents…"}
  .top-document-search button{padding:8px 9px;font-size:10px}
  .top-actions{gap:5px}
}

/* R12 direct document approval workflow */
.approval-action-panel{border:1px solid #dbe6f4;background:#f8fbff;border-radius:10px;padding:16px;margin-bottom:18px}.approval-submit-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.approval-submit-row h3{font-size:14px;margin:0 0 4px}.approval-submit-row .muted{font-size:11px;margin:0}.approval-submit-controls{display:flex;align-items:center;gap:8px;min-width:360px}.approval-submit-controls select{min-width:190px;flex:1}.approval-status-note{display:flex;align-items:center;gap:10px;font-size:12px;color:#536176}.approval-action-panel .form-message{margin:8px 0 0}.table-action.danger{border-color:#f1c6c6;color:#b42318}.notice.error{background:#fff0f0;border-color:#f2c6c6;color:#a32121}
@media(max-width:760px){.approval-submit-row{align-items:stretch;flex-direction:column}.approval-submit-controls{min-width:0;flex-direction:column;align-items:stretch}.approval-submit-controls select,.approval-submit-controls button{width:100%}}


/* R13.2 – restore original blue theme and prevent document/category content clipping */
html, body { max-width:100%; overflow-x:hidden; }
.main-area, .content, .page-content, .workspace, .content-area {
  min-width:0; max-width:100%; box-sizing:border-box;
}
.main-area { overflow-x:hidden; }
.panel, .card, .table-wrap, .table-container, .category-library-card {
  min-width:0; max-width:100%; box-sizing:border-box;
}
.table-wrap, .table-container { overflow-x:auto; }
.category-library {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  width:100%; max-width:100%; min-width:0; box-sizing:border-box;
  gap:14px; align-items:start;
}
.category-library-card { overflow:hidden; }
.category-library-head { min-width:0; flex-wrap:wrap; }
.category-document-link { white-space:normal; overflow-wrap:anywhere; }
@media(max-width:1050px) {
  .category-library { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:650px) {
  .category-library { grid-template-columns:minmax(0,1fr); }
  .main-area { width:100%; }
}


/* R13.3 – full-width category panel and styled category document links */
.dashboard-grid {
  grid-template-columns:minmax(0,1fr) !important;
  align-items:stretch;
}
#category-library.category-library {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  width:100%;
  max-width:100%;
  min-width:0;
  gap:16px;
  align-items:stretch;
}
#category-library .category-library-card {
  min-width:0;
  width:100%;
  box-sizing:border-box;
  background:#fff;
  border:1px solid #d9e4f2;
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 3px 12px rgba(20,48,88,.055);
}
#category-library .category-library-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:15px;
  background:#f3f7fc;
  border-bottom:1px solid #e3ebf5;
}
#category-library .category-library-head h3 {
  margin:1px 0 5px;
  color:#183b68;
  font-size:14px;
  line-height:1.35;
}
#category-library .category-library-head p {
  margin:0;
  color:#71839a;
  font-size:11px;
  line-height:1.45;
}
#category-library .category-library-icon {
  display:grid;
  place-items:center;
  flex:0 0 36px;
  width:36px;
  height:36px;
  border-radius:9px;
  background:#e8f0fb;
  color:#245da8;
  font-size:20px;
  font-weight:700;
}
#category-library .category-count {
  flex:0 0 auto;
  border:1px solid #d6e3f3;
  background:#fff;
  color:#245da8;
  border-radius:7px;
  padding:7px 10px;
  font-size:11px;
  white-space:nowrap;
  cursor:pointer;
}
#category-library .category-document-list {
  list-style:none;
  margin:0;
  padding:4px 15px;
}
#category-library .category-document-list li {
  list-style:none;
  margin:0;
  padding:11px 0;
  border-bottom:1px solid #edf1f6;
  min-width:0;
}
#category-library .category-document-list li:last-child { border-bottom:0; }
#category-library button.category-document-link {
  display:block;
  width:100%;
  max-width:100%;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  color:#1769a6;
  text-align:left;
  font:600 12px/1.5 inherit;
  cursor:pointer;
  white-space:normal;
  overflow-wrap:anywhere;
  box-shadow:none;
}
#category-library button.category-document-link:hover {
  color:#0d4f86;
  text-decoration:underline;
}
#category-library .category-document-meta {
  display:block;
  margin-top:4px;
  color:#7b8999;
  font-size:10px;
  line-height:1.4;
}
#category-library .category-empty,
#category-library .empty-state {
  padding:16px;
  color:#7b8999;
  font-size:12px;
}
#category-library .unclassified-card {
  border-style:dashed;
  border-color:#c7d5e7;
}
@media(max-width:1050px) {
  #category-library.category-library { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:650px) {
  #category-library.category-library { grid-template-columns:minmax(0,1fr); }
  #category-library .category-library-head { flex-wrap:wrap; }
}


/* R13.4 – repair main content alignment and document/category layout */
html, body { width:100%; max-width:100%; overflow-x:hidden; }
.app-shell { width:100%; max-width:100%; overflow-x:clip; }
.main-area {
  width:auto;
  min-width:0;
  max-width:calc(100% - 248px);
  margin-left:248px;
  overflow-x:hidden;
}
.content {
  width:100%;
  max-width:none;
  min-width:0;
  margin:0;
  padding:28px 30px;
}
.topbar { width:100%; min-width:0; }
.panel, .dashboard-grid, .panel-heading { min-width:0; }
.table-wrap {
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.table-wrap table {
  width:100%;
  min-width:850px;
  border-collapse:collapse;
}
.table-wrap th, .table-wrap td { white-space:normal; }
.table-wrap td:first-child { min-width:240px; }
.table-wrap td.row-actions { white-space:nowrap; }
#documents-table, #recent-documents, #search-results {
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:auto;
}
#category-library.category-library {
  width:100%;
  max-width:100%;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
}
#category-library .category-library-card { min-width:0; }
@media(max-width:1100px) {
  .main-area { max-width:calc(100% - 220px); margin-left:220px; }
  #category-library.category-library { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .main-area { width:100%; max-width:100%; margin-left:0; }
  .content { padding:20px 14px; }
  #category-library.category-library { grid-template-columns:minmax(0,1fr); }
  .table-wrap table { min-width:760px; }
}


/* R13.5 – cleaner dashboard overview hierarchy */
.dashboard-overview .dashboard-welcome { margin-bottom:22px; }
.dashboard-section-heading { display:flex; align-items:end; justify-content:space-between; margin:0 0 12px; }
.dashboard-section-heading h2 { font-size:16px; margin:0 0 3px; }
.dashboard-section-heading p { margin:0; font-size:11px; color:var(--muted); }
.dashboard-overview .dashboard-stats {
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}
.dashboard-overview .stat-card {
  min-width:0;
  min-height:112px;
  padding:17px 19px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.dashboard-overview .stat-card>strong { font-size:27px; margin:8px 0 1px; }
.dashboard-category-panel { margin-bottom:18px; }
.dashboard-category-panel .panel-heading { margin-bottom:18px; }
#category-library.category-library {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  align-items:stretch;
}
#category-library .category-library-card {
  min-width:0;
  padding:17px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fbfcfe;
}
#category-library .category-library-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding-bottom:13px;
  border-bottom:1px solid var(--line);
}
#category-library .category-library-head>div {
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}
#category-library .category-library-icon {
  flex:0 0 34px;
  width:34px;height:34px;
  display:grid;place-items:center;
  border-radius:9px;
  background:var(--blue2);
  color:var(--blue);
  font-size:17px;
}
#category-library .category-library-head h3 { margin:1px 0 4px; font-size:13px; }
#category-library .category-library-head p { margin:0; color:var(--muted); font-size:10px; line-height:1.45; }
#category-library .category-count {
  flex:0 0 auto;
  border:1px solid #d8e3f2;
  border-radius:8px;
  background:#fff;
  color:var(--blue);
  padding:6px 8px;
  font-size:10px;
  font-weight:700;
}
#category-library .category-count span { display:block; margin-top:3px; font-size:9px; font-weight:600; }
#category-library .category-document-list {
  list-style:none;
  margin:0;padding:8px 0 0;
}
#category-library .category-document-list li {
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:8px 0;
  border-bottom:1px solid #edf1f6;
}
#category-library .category-document-list li:last-child { border-bottom:0; }
#category-library .category-document-link {
  border:0;background:transparent;padding:0;
  text-align:left;color:var(--blue);
  font-size:11px;font-weight:650;line-height:1.45;
}
#category-library .category-document-link:hover { text-decoration:underline; }
#category-library .category-document-meta { color:var(--muted);font-size:9px; }
#category-library .category-empty { padding:16px 0 4px;color:var(--muted);font-size:11px; }
#category-library .unclassified-card { border-style:dashed;background:#fffdf8; }
.dashboard-quick-panel { margin-bottom:18px; }
.dashboard-quick-actions { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
.dashboard-quick-actions .action-row {
  min-width:0;min-height:70px;
  border:1px solid var(--line);border-radius:10px;
  padding:12px;background:#fff;gap:10px;
}
.dashboard-quick-actions .action-row:hover { border-color:#b8cbea;background:#f8fbff; }
.dashboard-quick-actions .quick-icon {
  flex:0 0 34px;width:34px;height:34px;
  display:grid;place-items:center;
  border-radius:9px;background:var(--blue2);color:var(--blue);
  font-size:18px;font-weight:700;
}
.dashboard-quick-actions .action-row div { min-width:0; }
.dashboard-quick-actions .action-row em { color:var(--blue);font-style:normal; }
.dashboard-overview .panel { margin-bottom:18px; }
@media(max-width:1050px) {
  #category-library.category-library { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-quick-actions { grid-template-columns:1fr; }
}
@media(max-width:680px) {
  .dashboard-overview .dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr));gap:9px; }
  #category-library.category-library { grid-template-columns:minmax(0,1fr); }
  .dashboard-overview .stat-card { min-height:100px;padding:13px; }
  .dashboard-overview .page-heading { align-items:flex-start;gap:12px; }
  .dashboard-overview .date-chip { white-space:nowrap; }
  .expiry-panel .panel-heading { align-items:flex-start;flex-direction:column;gap:10px; }
}

.factory-group{padding:12px 0;border-top:1px solid var(--line)}
.factory-heading{display:flex;justify-content:space-between;align-items:center;color:var(--ink);font-size:12px;font-weight:700;margin-bottom:8px}
.factory-heading b{background:var(--blue2);color:var(--blue);border-radius:14px;padding:3px 8px;font-size:10px}
.product-subfolders{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-left:12px}
.product-subfolder{background:#f7f9fc;border:1px solid var(--line);border-radius:8px;padding:9px;min-width:0}
.product-subfolder>div{font-size:11px;font-weight:700;color:var(--ink);margin-bottom:7px}
.product-subfolder small{display:block;color:var(--muted);font-weight:400;margin-top:3px}
.factory-group>.category-document-link,.product-subfolder>.category-document-link{display:block;width:100%;text-align:left;margin:5px 0;padding:3px 0;border:0;background:transparent;color:var(--blue);font-size:10px;overflow-wrap:anywhere}
@media(max-width:700px){.product-subfolders{grid-template-columns:1fr}}

/* R13.8 document factory filter */
#factory-filter { min-width: 150px; }


/* R14.0 – Compact white dashboard with expiry status */
.dashboard-overview .dashboard-welcome { margin-bottom:12px; }
.dashboard-overview .dashboard-welcome h1 { font-size:25px; margin:0 0 4px; }
.dashboard-overview .dashboard-welcome .muted { margin:0; font-size:12px; }
.dashboard-overview .dashboard-section-heading { margin-bottom:8px; }
.dashboard-overview .dashboard-stats {
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.dashboard-overview .stat-card {
  min-height:88px;
  padding:12px 14px;
  border-radius:10px;
}
.dashboard-overview .stat-card>strong { font-size:24px; margin:5px 0 0; }
.dashboard-overview .stat-top { font-size:11px; }
.dashboard-overview .stat-icon { width:30px;height:30px; }
.dashboard-overview .stat-card small { font-size:9px; }
.dashboard-overview .dashboard-quick-panel { margin-bottom:12px; }
.dashboard-overview .dashboard-quick-panel .panel-heading { margin-bottom:8px; }
.dashboard-overview .dashboard-quick-actions { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px; }
.dashboard-overview .dashboard-quick-actions .action-row { min-height:54px;padding:9px 12px; }
.dashboard-compact-grid {
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(340px,.9fr);
  gap:14px;
  align-items:start;
}
.dashboard-main-column,.dashboard-side-column { min-width:0;display:flex;flex-direction:column;gap:12px; }
.dashboard-compact-grid .panel { margin:0; }
.dashboard-compact-grid .panel-heading { margin-bottom:10px; }
.dashboard-compact-grid .panel-heading h2 { font-size:15px; }
.dashboard-side-column .dashboard-category-panel #category-library { grid-template-columns:1fr;gap:8px; }
.dashboard-side-column #category-library .category-library-card { padding:11px 12px; }
.dashboard-side-column #category-library .category-library-head { padding-bottom:8px; }
.dashboard-side-column #category-library .factory-group { padding-top:7px;padding-bottom:4px; }
.dashboard-side-column #category-library .product-subfolder { padding:6px 8px; }
.dashboard-side-column .expiry-panel .panel-heading { align-items:flex-start;flex-direction:column;gap:7px; }
.dashboard-side-column .expiry-summary { justify-content:flex-start; }
.dashboard-side-column .expiry-table th,
.dashboard-side-column .expiry-table td { padding:8px 9px;font-size:10px; }
.dashboard-side-column .expiry-table th:nth-child(4),
.dashboard-side-column .expiry-table td:nth-child(4),
.dashboard-side-column .expiry-table th:nth-child(5),
.dashboard-side-column .expiry-table td:nth-child(5) { display:none; }
.dashboard-main-column .recent-panel .table-wrap { overflow-x:auto; }
.dashboard-main-column .recent-panel table { min-width:560px; }
.dashboard-overview .dashboard-category-panel .panel-heading p,
.dashboard-overview .expiry-panel .panel-heading p { font-size:10px; }
@media (max-width:1100px) {
  .dashboard-overview .dashboard-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-compact-grid { grid-template-columns:minmax(0,1fr); }
  .dashboard-side-column .dashboard-category-panel #category-library { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:700px) {
  .dashboard-overview .dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-overview .dashboard-quick-actions { grid-template-columns:1fr; }
  .dashboard-side-column .dashboard-category-panel #category-library { grid-template-columns:1fr; }
}


/* R14.2 – soft navy page canvas and sequential dashboard panels */
body { background:#e8eef7; }
.main-area { background:#e8eef7; }
.dashboard-compact-grid {
  grid-template-columns:minmax(0,1fr);
}
.dashboard-main-column {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.dashboard-main-column .recent-panel,
.dashboard-main-column .dashboard-category-panel {
  width:100%;
}
.dashboard-main-column #category-library {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
@media (max-width:1100px) {
  .dashboard-main-column #category-library {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:700px) {
  .dashboard-main-column #category-library {
    grid-template-columns:1fr;
  }
}

/* R14.3 product filter */
#product-filter { min-width:150px; }

/* R15.0 QMS module */
.qms-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}.qms-tab{border:1px solid var(--border,#dce3ec);background:#fff;color:#34445b;border-radius:9px;padding:10px 15px;font-weight:650;cursor:pointer}.qms-tab.active{background:#174ea6;color:#fff;border-color:#174ea6}.qms-list{display:grid;gap:10px}.qms-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px;border:1px solid var(--border,#e1e7ef);border-radius:11px;background:#fff}.qms-row strong{color:#172b4d}.qms-row p{margin:6px 0;color:#607087}.qms-row small{color:#738198}.qms-row-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.qms-json{white-space:pre-wrap;overflow-wrap:anywhere;background:#f5f7fa;padding:14px;border-radius:8px}.qms-admin-only.hidden{display:none!important}@media(max-width:650px){.qms-row{align-items:flex-start;flex-direction:column}.qms-row-actions{justify-content:flex-start}}
