:root{
    --bg:#f7f9fb;
    --panel:#ffffff;
    --text:#020817;
    --muted:#486284;
    --line:#dbe3ec;
    --navy:#0f172a;
    --danger:#ff003d;
    --success:#0f766e;
    --shadow:0 2px 8px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text);font-size:14px}
body.modal-open{overflow:hidden}
body.sidebar-open{overflow:hidden}
a{color:inherit;text-decoration:none}
.shell{display:grid;grid-template-columns:255px 1fr;min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column}
.sidebar-backdrop{display:none}
.brand{height:93px;padding:25px 24px;border-bottom:1px solid var(--line);display:grid;gap:7px;align-content:center}
.brand strong{font-size:20px;line-height:1;font-weight:800}
.brand span{font-size:12px;color:var(--muted)}
.sidebar nav{display:grid;gap:4px;padding:18px 12px}
.sidebar a,.nav-toggle{height:36px;display:flex;align-items:center;gap:12px;border-radius:7px;padding:0 12px;color:#020817;font-weight:500}
.nav-toggle{width:100%;border:0;background:transparent;cursor:pointer;font:inherit;justify-content:space-between;text-align:left}
.nav-toggle span{display:flex;align-items:center;gap:12px;min-width:0}
.sidebar a:hover,.nav-toggle:hover{background:#f1f5f9}
.sidebar a.active,.nav-toggle.active{background:var(--navy);color:#fff}
.sidebar a i,.nav-toggle i{font-size:14px;width:18px;text-align:center;flex:0 0 18px;color:#0f172a;opacity:.9}
.sidebar a.active i,.nav-toggle.active i{color:#fff;opacity:1}
.submenu-arrow{margin-left:auto;width:auto!important;flex:0 0 auto!important;font-size:11px!important;transition:transform .18s ease}
.nav-toggle[aria-expanded="true"] .submenu-arrow{transform:rotate(180deg)}
.submenu{display:grid;gap:3px;margin:-2px 0 6px 30px;padding-left:10px;border-left:1px solid var(--line)}
.submenu[hidden]{display:none}
.submenu a{height:31px;font-size:13px;border-radius:6px;color:#486284;padding:0 10px}
.submenu a i{font-size:12px;width:15px;flex-basis:15px;color:#486284}
.submenu a.active{background:#eef3f8;color:#020817}
.submenu a.active i{color:#020817}
.sidebar-user{margin-top:auto;border-top:1px solid var(--line);padding:16px}
.user-row{display:flex;align-items:center;gap:10px;margin-bottom:14px;min-width:0}
.avatar{width:30px;height:30px;border:2px solid #6b7f99;border-radius:50%;display:grid;place-items:center;color:#486284;font-weight:800}
.user-meta{min-width:0;display:grid;gap:3px}
.user-meta strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.user-meta span{justify-self:start;background:#eef3f8;border-radius:999px;padding:2px 8px;font-size:10px;font-weight:700}
.main{padding:29px 33px;overflow:auto}
.topbar{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:26px}
.page-title{display:flex;align-items:flex-start;gap:12px;min-width:0}
.mobile-menu-btn{display:none;width:40px;height:40px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--navy);box-shadow:var(--shadow);cursor:pointer;place-items:center;flex:0 0 40px}
.menu-toggle-icon{font-size:17px;line-height:1}
.topbar h1{font-size:30px;line-height:1.08;margin:0 0 6px;font-weight:800;letter-spacing:0}
.topbar span{color:var(--muted);font-size:16px}
.panel,.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.panel{padding:26px;margin-bottom:24px}
.panel h2{font-size:16px;margin:0 0 28px;font-weight:800}
.stats{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:16px;margin-bottom:24px}
.card{min-height:120px;padding:27px 24px;position:relative}
.card span{display:block;color:var(--muted);font-size:14px;margin-bottom:18px}
.card strong{font-size:30px;line-height:1;font-weight:800}
.stat-icon{position:absolute;right:24px;top:28px;color:#64748b;font-size:15px;opacity:.85}
.quick-links,.actions{display:flex;gap:12px;flex-wrap:wrap}
.quick-links a{height:38px;display:inline-flex;align-items:center;gap:9px;padding:0 14px;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:var(--shadow);font-weight:700}
.quick-links a i{font-size:14px;color:#475569}
.btn{height:37px;border:1px solid var(--line);background:#fff;color:var(--text);padding:0 15px;border-radius:8px;cursor:pointer;font-weight:800;box-shadow:var(--shadow);display:inline-flex;gap:10px;align-items:center;justify-content:center}
.btn i{font-size:13px}
.btn.primary{background:var(--navy);border-color:var(--navy);color:#fff;min-width:112px}
.logout-button{width:100%;height:37px;border:1px solid var(--line);background:#fff;color:var(--text);padding:0 15px;border-radius:8px;cursor:pointer;font-weight:800;box-shadow:none;display:inline-flex;gap:10px;align-items:center;justify-content:center}
.logout-button i{font-size:13px;line-height:1}
.form,.grid-form{display:grid;gap:14px}
.grid-form{grid-template-columns:repeat(3,minmax(180px,1fr));align-items:end}
.grid-form .wide{grid-column:1/-1}
.attendance-form{grid-template-columns:1.1fr .8fr .8fr 1fr 1fr 1.1fr 1fr}
label{display:grid;gap:7px;font-size:14px;font-weight:700;color:#020817}
label .req{display:inline-flex;align-items:center;gap:4px;color:#020817}
label .req b{color:var(--danger);font-weight:800}
input,select,textarea{width:100%;height:37px;border:1px solid var(--line);border-radius:8px;padding:0 13px;background:#fff;color:var(--text);font:inherit;font-weight:400;box-shadow:0 1px 3px rgba(15,23,42,.08)}
textarea{height:auto;min-height:78px;padding:11px 13px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:0;border-color:#8aa4c2;box-shadow:0 0 0 3px rgba(59,130,246,.12)}
.table-wrap{overflow:auto;margin-left:-26px;margin-right:-26px}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{text-align:left;padding:13px 10px;border-bottom:1px solid var(--line);vertical-align:middle;white-space:nowrap}
th:first-child,td:first-child{padding-left:10px}
th{color:#243b53;background:#eef3f8;font-weight:800}
th[data-sort]{cursor:pointer;position:relative;padding-right:24px;user-select:none}
th[data-sort]::after{content:"\f0dc";font-family:"Font Awesome 7 Free";font-weight:900;position:absolute;right:8px;top:50%;transform:translateY(-50%);font-size:11px;color:#64748b;opacity:.55}
th[data-sort].sorted-asc::after{content:"\f0de";opacity:1;color:#0f172a}
th[data-sort].sorted-desc::after{content:"\f0dd";opacity:1;color:#0f172a}
td{height:52px}
.badge{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;background:#eef8f6;color:var(--success);font-weight:800;font-size:12px}
.link{border:0;background:transparent;color:#020817;cursor:pointer;font-weight:800;padding:4px}
.danger{color:var(--danger)}
.row-actions{display:flex;gap:14px;align-items:center}
.row-actions form{margin:0}
.icon-action{width:28px;height:28px;border:0;background:transparent;color:#020817;cursor:pointer;border-radius:6px;display:inline-grid;place-items:center;padding:0}
.icon-action:hover{background:#f1f5f9}
.icon-action i{font-size:15px;line-height:1}
.delete-action{color:var(--danger)}
.empty-row{text-align:center;color:var(--muted);height:68px}
.flash-stack{position:fixed;right:24px;top:24px;z-index:1000;display:grid;gap:10px;width:min(420px,calc(100vw - 32px))}
.alert{padding:13px 14px;border-radius:10px;margin-bottom:14px;border:1px solid transparent;display:flex;align-items:flex-start;gap:10px;box-shadow:0 12px 30px rgba(15,23,42,.14);font-weight:700}
.flash-stack .alert{margin-bottom:0}
.alert>i{font-size:17px;margin-top:1px;flex:0 0 auto}
.alert span{line-height:1.35}
.alert button{margin-left:auto;border:0;background:transparent;color:inherit;cursor:pointer;padding:0;opacity:.75}
.alert button:hover{opacity:1}
.alert.success{background:#ecfdf3;color:#067647;border-color:#abefc6}
.alert.error{background:#fef3f2;color:#b42318;border-color:#fecdca}
.alert.info{background:#eff8ff;color:#175cd3;border-color:#b2ddff}
.alert.warning{background:#fffaeb;color:#b54708;border-color:#fedf89}
.inline-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.guest{min-height:100vh;display:grid;place-items:center;background:#f7f9fb;padding:24px}
.auth-card{width:min(448px,92vw);background:#fff;border:1px solid #d9e2ec;border-radius:14px;padding:28px 24px 25px;box-shadow:0 2px 6px rgba(15,23,42,.10)}
.auth-head{margin-bottom:24px}
.auth-head h1{font-size:24px;line-height:1.1;margin:0 0 8px;font-weight:800;letter-spacing:0;color:#020817}
.auth-head p{margin:0;color:#486284;font-size:14px;line-height:1.4}
.auth-tabs{height:36px;padding:3px;background:#edf2f7;border-radius:9px;display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:21px}
.auth-tabs a{display:grid;place-items:center;border-radius:8px;color:#486284;font-weight:700}
.auth-tabs a.active{background:#fff;color:#020817;box-shadow:0 1px 4px rgba(15,23,42,.16)}
.auth-form{display:grid;gap:20px}
.auth-form label{gap:7px}
.auth-form input{height:36px;background:#e8f1ff;border-color:#d8e2ee;box-shadow:0 1px 4px rgba(15,23,42,.16)}
.auth-submit{height:36px;border:0;background:var(--navy);color:#fff;border-radius:7px;font-weight:800;cursor:pointer;box-shadow:0 2px 5px rgba(15,23,42,.22)}
.auth-submit:hover{background:#111c31}
.empty-state{padding:40px;background:#fff;border-radius:12px}
.icon-btn{width:30px;height:30px;border:0;background:#fff;color:#475569;font-size:22px;cursor:pointer;border-radius:6px}
.icon-btn:hover{background:#f1f5f9}
.modal-form{grid-template-columns:1fr 1fr;padding:8px 24px 24px}
.sectioned-form{display:grid;grid-template-columns:1fr;gap:18px}
.sectioned-form fieldset{border:1px solid var(--line);border-radius:10px;padding:17px 18px 18px;margin:0;background:#fff}
.sectioned-form legend{padding:0 8px;font-size:15px;font-weight:800;color:#020817}
.form-section-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}
.form-section-grid.compact{gap:13px 16px}
.form-section-grid .wide{grid-column:1/-1}
.check-line{display:flex;align-items:center;gap:9px;height:37px}
.check-line input{width:16px;height:16px;box-shadow:none}
.wizard-section-stack{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.wizard-subsection{border:1px solid var(--line);border-radius:10px;background:#fbfdff;padding:16px;display:grid;gap:14px;min-height:126px}
.wizard-subsection:last-child{grid-column:1/-1}
.subsection-title{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #edf2f7;padding-bottom:11px}
.subsection-title h3{margin:0;font-size:14px;line-height:1.2;font-weight:800;color:#020817}
.toggle-line{display:inline-flex;align-items:center;gap:8px;height:auto;font-size:13px;font-weight:800;color:#243b53;white-space:nowrap}
.toggle-line input{width:16px;height:16px;box-shadow:none;flex:0 0 16px}
.inline-check{height:37px;justify-content:flex-start;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 12px}
.form-actions{display:flex;justify-content:flex-end;gap:10px}
.section-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px;padding-top:15px;border-top:1px solid #edf2f7}
.detail-panel{scroll-margin-top:24px}
.detail-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.detail-panel-head h2{margin:0 0 6px}
.detail-panel-head p{margin:0;color:var(--muted);font-weight:700}
.detail-tabs{height:38px;padding:3px;background:#edf2f7;border-radius:9px;display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-bottom:18px}
.detail-tabs button{border:0;background:transparent;border-radius:7px;color:#486284;font-weight:800;cursor:pointer}
.detail-tabs button.active{background:#fff;color:#020817;box-shadow:0 1px 4px rgba(15,23,42,.14)}
.detail-tab-panel[hidden]{display:none}
.timeline{display:grid;gap:12px;margin-top:18px}
.timeline-item{display:grid;grid-template-columns:18px 1fr;gap:10px;align-items:start}
.timeline-dot{width:10px;height:10px;border-radius:50%;background:var(--navy);margin:7px 0 0 4px;box-shadow:0 0 0 4px #eef3f8}
.timeline-body{border:1px solid var(--line);border-radius:8px;background:#fbfdff;padding:12px 14px;display:grid;gap:8px}
.timeline-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.timeline-head strong{font-size:14px}
.timeline-head span{height:23px;display:inline-flex;align-items:center;border-radius:999px;background:#eef3f8;color:#486284;padding:0 9px;font-size:12px;font-weight:800}
.timeline-body p{margin:0;white-space:pre-wrap;line-height:1.45;color:#243b53}
.timeline-meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--muted);font-weight:700}
.wizard-panel{scroll-margin-top:24px}
.wizard-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}
.wizard-head h2{margin:0 0 6px}
.wizard-head p{margin:0;color:var(--muted)}
.wizard-steps{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-bottom:18px}
.wizard-steps button{height:38px;border:1px solid var(--line);background:#fff;border-radius:8px;font-weight:800;cursor:pointer;color:#475569}
.wizard-steps button.active{background:var(--navy);border-color:var(--navy);color:#fff}
.wizard-step{display:none}
.wizard-step.active{display:block}
.wizard-actions{display:flex;justify-content:flex-end;gap:10px}
.datatable-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:16px;color:var(--muted)}
.pager{display:flex;gap:8px}
.pager .btn:disabled{opacity:.5;cursor:not-allowed}
.thumb{width:34px;height:34px;border-radius:50%;object-fit:cover;display:inline-grid;place-items:center;background:#eef3f8;color:#64748b}
.logo-preview img{max-height:74px;max-width:180px;border:1px solid var(--line);border-radius:8px;padding:8px;background:#fff}
.settings-form{max-width:520px}
.settings-module-form{max-width:1120px}
.settings-label{display:block;margin:0 0 8px;font-weight:800;color:#020817}
.settings-check-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px}
.payroll-rule-summary{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin:-8px 0 18px}
.payroll-rule-summary span{display:grid;gap:5px;min-height:54px;border:1px solid var(--line);border-radius:8px;background:#fbfdff;padding:10px 12px;color:var(--muted);font-weight:700}
.payroll-rule-summary strong{color:#020817;font-weight:800}
.leave-balance-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px}
.leave-balance-card{border:1px solid var(--line);border-radius:8px;background:#fbfdff;padding:14px 16px;display:grid;gap:8px}
.leave-balance-card span{color:var(--muted);font-weight:800}
.leave-balance-card strong{font-size:26px;line-height:1;color:#020817}
.leave-balance-card small{color:var(--muted);font-weight:700}
.filter-bar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:-8px 0 18px}
.filter-bar input,.filter-bar select{max-width:240px}
.ajax-table{table-layout:fixed;min-width:980px}
.ajax-table th,.ajax-table td{overflow:hidden;text-overflow:ellipsis}
.ajax-table th:last-child,.ajax-table td:last-child{overflow:visible;text-overflow:clip}
.profile-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.profile-title{display:flex;align-items:center;gap:14px;min-width:0}
.profile-title h2{margin:0 0 6px;font-size:22px}
.profile-title p{margin:0;color:var(--muted)}
.profile-photo{width:58px;height:58px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#eef3f8;color:#64748b;flex:0 0 58px}
.profile-tabs nav{display:flex;gap:8px;flex-wrap:wrap;margin:-4px 0 22px}
.profile-tabs nav a{height:34px;display:inline-flex;align-items:center;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:#fff;font-weight:800;color:#486284}
.profile-tabs nav a:hover{background:#f1f5f9;color:#020817}
.profile-section{border-top:1px solid var(--line);padding-top:20px;margin-top:20px;scroll-margin-top:20px}
.profile-section:first-of-type{border-top:0;margin-top:0}
.detail-grid{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:14px}
.detail-grid span{display:grid;gap:6px;color:var(--muted);font-weight:700}
.detail-grid strong{color:#020817;font-weight:500;white-space:normal;line-height:1.35}
.document-upload{margin-bottom:18px}
.document-table{min-width:760px}
[type="file"]::file-selector-button {margin-top: 7px;margin-left: -5px;}
@media(max-width:1100px){.stats{grid-template-columns:repeat(2,1fr)}.attendance-form,.grid-form{grid-template-columns:1fr 1fr}}
@media(max-width:820px){.shell{display:block;min-height:100vh}.sidebar{position:fixed;top:0;left:0;z-index:1100;width:min(292px,86vw);height:100vh;transform:translateX(-105%);transition:transform .22s ease;box-shadow:18px 0 42px rgba(15,23,42,.18)}body.sidebar-open .sidebar{transform:translateX(0)}.sidebar-backdrop{position:fixed;inset:0;z-index:1090;background:rgba(15,23,42,.42);display:block;opacity:0;visibility:hidden;transition:opacity .22s ease,visibility .22s ease}body.sidebar-open .sidebar-backdrop{opacity:1;visibility:visible}.sidebar nav{display:grid;grid-template-columns:1fr;overflow:auto;padding-bottom:20px}.sidebar-user{margin-top:auto}.mobile-menu-btn{display:grid}.main{padding:18px 14px}.stats,.attendance-form,.grid-form,.modal-form,.form-section-grid,.wizard-steps,.detail-tabs,.detail-grid,.wizard-section-stack,.settings-check-grid,.payroll-rule-summary,.leave-balance-grid{grid-template-columns:1fr}.wizard-subsection:last-child{grid-column:auto}.subsection-title{align-items:flex-start;flex-direction:column}.topbar,.profile-head,.detail-panel-head{align-items:stretch;flex-direction:column;margin-bottom:18px}.topbar h1{font-size:25px}.topbar span{font-size:14px}.detail-tabs{height:auto}.detail-tabs button{height:32px}.table-wrap{margin-left:-14px;margin-right:-14px}.datatable-footer{align-items:flex-start;flex-direction:column}.filter-bar input,.filter-bar select{max-width:none}.filter-bar .btn{flex:1 1 120px}}
