*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --green:#1A5C2A;
  --green-dark:#0F3D1A;
  --cream:#F5EFE6;
  --cream2:#EDE5D8;
  --gold:#B8922A;
  --gold-lt:#D4AE5A;
  --brown:#3D1A00;
  --espresso:#2C1810;
  --white:#FFFFFF;
  --danger:#A23B2E;
  --ok:#2F6B3A;
}
html,body{height:100%}
body{
  font-family:'Work Sans',Arial,sans-serif;
  background:var(--cream);
  color:var(--espresso);
  line-height:1.5;
}

/* ---------- Login page ---------- */
.login-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem;
}
.login-card{
  width:100%;
  max-width:380px;
  background:var(--white);
  border:1px solid rgba(61,26,0,0.12);
  border-radius:6px;
  padding:2.5rem 2rem;
  box-shadow:0 10px 30px rgba(15,61,26,0.08);
}
.login-home-link{
  display:inline-block;
  font-family:'Work Sans',sans-serif;
  font-size:.8rem;
  color:var(--gold);
  text-decoration:none;
  margin-bottom:1rem;
}
.login-home-link:hover{
  text-decoration:underline;
}
.login-brand{
  text-align:center;
  margin-bottom:1.75rem;
}
.login-brand .lb-top{
  font-family:'Spectral',serif;
  font-size:1.6rem;
  font-weight:600;
  letter-spacing:.14em;
  color:var(--brown);
  text-transform:uppercase;
  display:block;
}
.login-brand .lb-bot{
  font-family:'Work Sans',sans-serif;
  font-size:.7rem;
  letter-spacing:.25em;
  color:var(--gold);
  text-transform:uppercase;
  margin-top:.35rem;
  display:block;
}
.login-field{margin-bottom:1.1rem}
.login-field label{
  display:block;
  font-size:.7rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--brown);
  margin-bottom:.4rem;
}
.login-field input{
  width:100%;
  padding:.65rem .8rem;
  border:1px solid rgba(61,26,0,0.25);
  border-radius:4px;
  font-family:inherit;
  font-size:.95rem;
  background:var(--cream2);
  color:var(--espresso);
}
.login-field input:focus{
  outline:2px solid var(--green);
  outline-offset:1px;
  background:var(--white);
}
.login-submit{
  width:100%;
  padding:.7rem;
  margin-top:.5rem;
  border:none;
  border-radius:4px;
  background:var(--green);
  color:var(--white);
  font-family:inherit;
  font-size:.85rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .15s;
}
.login-submit:hover{background:var(--green-dark)}
.login-error{
  background:rgba(162,59,46,0.1);
  color:var(--danger);
  border:1px solid rgba(162,59,46,0.3);
  border-radius:4px;
  padding:.6rem .8rem;
  font-size:.82rem;
  margin-bottom:1.1rem;
}

/* ---------- Dashboard shell ---------- */
.erp-shell{
  display:flex;
  min-height:100vh;
}
.erp-sidebar{
  width:164px;
  flex-shrink:0;
  background:var(--green-dark);
  color:var(--cream);
  display:flex;
  flex-direction:column;
}
.erp-sidebar-brand{
  padding:1.4rem .7rem;
  border-bottom:1px solid rgba(245,239,230,0.12);
}
.erp-sidebar-brand .sb-top{
  font-family:'Spectral',serif;
  font-size:1.02rem;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--white);
  display:block;
}
.erp-sidebar-brand .sb-bot{
  font-size:.62rem;
  letter-spacing:.2em;
  color:var(--gold-lt);
  text-transform:uppercase;
  display:block;
  margin-top:.25rem;
}
.erp-nav{
  flex:1;
  padding:.75rem 0;
}
.erp-nav button{
  display:flex;
  align-items:center;
  gap:.5rem;
  width:100%;
  background:none;
  border:none;
  color:rgba(245,239,230,0.85);
  font-family:inherit;
  font-size:.8rem;
  text-align:left;
  padding:.65rem .7rem;
  cursor:pointer;
  border-left:3px solid transparent;
  transition:background .15s,color .15s;
}
.erp-nav button:hover{
  background:rgba(245,239,230,0.06);
  color:var(--white);
}
.erp-nav button.active{
  background:rgba(245,239,230,0.1);
  border-left-color:var(--gold);
  color:var(--white);
}
.erp-nav .icon{
  width:18px;
  text-align:center;
  font-size:1rem;
}
.erp-sidebar-footer{
  padding:1rem 1.2rem;
  border-top:1px solid rgba(245,239,230,0.12);
}
.erp-sidebar-footer .who{
  font-size:.75rem;
  color:rgba(245,239,230,0.6);
  margin-bottom:.6rem;
}
.erp-logout{
  display:block;
  text-align:center;
  padding:.5rem;
  border:1px solid rgba(245,239,230,0.25);
  border-radius:4px;
  color:var(--cream);
  text-decoration:none;
  font-size:.78rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  transition:background .15s;
}
.erp-logout:hover{background:rgba(245,239,230,0.08)}

.erp-settings-link{
  display:block;
  width:100%;
  text-align:center;
  padding:.5rem;
  margin-bottom:.5rem;
  border:1px solid rgba(245,239,230,0.25);
  border-radius:4px;
  background:none;
  color:var(--cream);
  font-family:inherit;
  font-size:.78rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .15s;
}
.erp-settings-link:hover{background:rgba(245,239,230,0.08)}

.erp-main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}
.erp-topbar{
  height:64px;
  flex-shrink:0;
  background:var(--white);
  border-bottom:1px solid rgba(61,26,0,0.1);
  display:flex;
  align-items:center;
  padding:0 1.75rem;
}
.erp-topbar h1{
  font-family:'Spectral',serif;
  font-size:1.3rem;
  font-weight:600;
  color:var(--brown);
}
.erp-content{
  flex:1;
  padding:1.75rem;
  overflow-y:auto;
}
.module-panel{display:none}
.module-panel.active{display:block}

.card-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:1rem;
  margin-bottom:1.5rem;
}
.stat-card{
  background:var(--white);
  border:1px solid rgba(61,26,0,0.1);
  border-left:4px solid var(--green);
  border-radius:5px;
  padding:1rem 1.2rem;
}
.stat-card h3{
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--brown);
  opacity:.75;
  margin-bottom:.5rem;
}
.stat-card .stat-value{
  font-family:'Spectral',serif;
  font-size:1.8rem;
  font-weight:600;
  color:var(--espresso);
}
.stat-card .stat-sub{
  font-size:.78rem;
  color:var(--espresso);
  opacity:.6;
  margin-top:.2rem;
}

.panel-block{
  background:var(--white);
  border:1px solid rgba(61,26,0,0.1);
  border-radius:5px;
  margin-bottom:1.5rem;
  overflow:hidden;
}
.panel-block-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:.9rem 1.2rem;
  border-bottom:1px solid rgba(61,26,0,0.08);
}
.panel-block-header h2{
  font-family:'Spectral',serif;
  font-size:1.05rem;
  color:var(--brown);
}
.btn{
  display:inline-block;
  padding:.45rem .9rem;
  border-radius:4px;
  border:none;
  font-family:inherit;
  font-size:.78rem;
  letter-spacing:.05em;
  text-transform:uppercase;
  cursor:pointer;
  background:var(--green);
  color:var(--white);
}
.btn:hover{background:var(--green-dark)}
.btn.secondary{
  background:transparent;
  border:1px solid var(--green);
  color:var(--green);
}

table.erp-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
table.erp-table th{
  text-align:left;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--brown);
  opacity:.7;
  padding:.6rem 1.2rem;
  border-bottom:1px solid rgba(61,26,0,0.1);
}
table.erp-table td{
  font-size:12px;
  padding:.65rem 1.2rem;
  border-bottom:1px solid rgba(61,26,0,0.06);
}
table.erp-table tr:last-child td{border-bottom:none}
table.erp-table.erp-table-sm{font-size:.75rem;}
table.erp-table.erp-table-sm th{padding:.35rem .7rem;}
table.erp-table.erp-table-sm td{padding:.35rem .7rem;}
table.erp-table th.gl-dr,table.erp-table th.gl-cr,table.erp-table th.gl-bal{text-align:right;}

.status-pill{
  display:inline-block;
  padding:.2rem .6rem;
  border-radius:999px;
  font-size:.7rem;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.status-pill.paid,.status-pill.approved{background:rgba(47,107,58,0.12);color:var(--ok)}
.status-pill.due,.status-pill.pending{background:rgba(184,146,42,0.15);color:var(--gold)}
.status-pill.overdue,.status-pill.refused{background:rgba(162,59,46,0.12);color:var(--danger)}

.empty-note{
  padding:1.5rem 1.2rem;
  font-size:.85rem;
  color:var(--espresso);
  opacity:.6;
}

@media (max-width:720px){
  .erp-sidebar{
    width:64px;
  }
  .erp-sidebar-brand,.erp-sidebar-footer .who{display:none}
  .erp-nav button span.label{display:none}
  .erp-logout{font-size:0}
  .erp-logout::before{font-size:1rem;content:"\23FB"}
  .erp-sidebar-footer{padding:.6rem .4rem}
  .erp-settings-link{font-size:0;padding:.5rem .2rem}
  #changePasswordLink::before{font-size:.95rem;content:"\1F511"}
  #manageUsersLink::before{font-size:.95rem;content:"\1F465"}
}

.table-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

@media (max-width:480px){
  table.erp-table{font-size:.75rem;min-width:560px}
  table.erp-table th,table.erp-table td{padding:.5rem .7rem}
  .panel-block-header{flex-wrap:wrap;gap:.5rem;align-items:flex-start}
  .panel-block-header h2{font-size:.92rem}
  .panel-block-header .btn{padding:.4rem .7rem;font-size:.68rem}
}

/* ---------- Row delete button ---------- */
.row-delete{
  background:none;
  border:none;
  color:var(--danger);
  font-size:1.1rem;
  line-height:1;
  cursor:pointer;
  opacity:.6;
  padding:.1rem .4rem;
}
.row-delete:hover{opacity:1}

/* ---------- Modal ---------- */
.modal-backdrop{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(44,24,16,0.45);
  align-items:center;
  justify-content:center;
  z-index:100;
  padding:1.5rem;
}
.modal-backdrop.open{display:flex}
.modal-box{
  background:var(--white);
  border-radius:6px;
  width:100%;
  max-width:420px;
  max-height:90vh;
  overflow-y:auto;
  box-shadow:0 20px 50px rgba(0,0,0,0.25);
}
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1.1rem 1.3rem;
  border-bottom:1px solid rgba(61,26,0,0.1);
}
.modal-header h2{
  font-family:'Spectral',serif;
  font-size:1.15rem;
  color:var(--brown);
}
.modal-close{
  background:none;
  border:none;
  font-size:1.4rem;
  line-height:1;
  cursor:pointer;
  color:var(--espresso);
  opacity:.6;
}
.modal-close:hover{opacity:1}
.modal-body{
  padding:1.3rem;
}
.modal-body select{
  width:100%;
  padding:.65rem .8rem;
  border:1px solid rgba(61,26,0,0.25);
  border-radius:4px;
  font-family:inherit;
  font-size:.95rem;
  background:var(--cream2);
  color:var(--espresso);
}
.modal-footer{
  display:flex;
  justify-content:flex-end;
  gap:.6rem;
  padding:1rem 1.3rem;
  border-top:1px solid rgba(61,26,0,0.1);
}

/* ===== HR MODULE TABS ===== */
.hr-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 16px;
}
.hr-tab {
  padding: 7px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  color: #5a5a5a;
  transition: all 0.15s;
}
.hr-tab:hover { background: #f0ebe3; }
.hr-tab.active {
  background: #1a3d1a;
  color: #fff;
  border-color: #1a3d1a;
  font-weight: 500;
}
.leave-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.leave-tab {
  padding: 5px 14px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  color: #666;
}
.leave-tab:hover { background: #f5f0e8; }
.leave-tab.active {
  background: #f0ebe3;
  border-color: #c8a96e;
  color: #3B2415;
  font-weight: 500;
}

.file-link { text-decoration: none; cursor: pointer; }
.file-link:hover { text-decoration: underline; }



/* ============================================================
   EMPLOYEE PORTAL — Option D shell (Step 5A)
   ============================================================ */
.emp-portal-shell {
  display: flex;
  min-height: calc(100vh - 120px);
  background: #f5f0e8;
}

.emp-portal-nav {
  width: 196px;
  flex-shrink: 0;
  background: #1a3a2a;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  gap: 2px;
}

.emp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.55);
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.13s, color 0.13s;
}
.emp-nav-item i { font-size: 17px; flex-shrink: 0; }
.emp-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.emp-nav-item.active {
  background: rgba(200,176,96,0.12);
  color: #c8b060;
  border-left-color: #c8b060;
}

.emp-portal-body {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.emp-page { display: block; }

.emp-leave-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 16px 0;
  border-bottom: 1px solid #e0ddd8;
  flex-wrap: wrap;
}
.emp-leave-tab {
  padding: 7px 16px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
  transition: background 0.12s, color 0.12s;
}
.emp-leave-tab:hover { background: #f0ebe2; color: #1a3a2a; }
.emp-leave-tab.active {
  background: #fff;
  color: #1a3a2a;
  border-color: #e0ddd8;
  font-weight: 600;
}

#dlAddSelfTaskWrap {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
#dlSelfTaskInput {
  flex: 1 1 0%;
  min-width: 0;
}

/* ── NA-86 Notification Bell ── */
.erp-topbar { justify-content: space-between; }

.notif-bell { position: relative; margin-left: auto; }

.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  font-size: 1.2rem;
  transition: background .15s;
}
.notif-bell-btn:hover { background: rgba(61,26,0,0.07); }

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--white);
  border: 1px solid rgba(61,26,0,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 999;
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(61,26,0,0.08);
}
.notif-dropdown-title {
  font-weight: 600;
  font-size: .85rem;
  color: var(--brown);
}
.notif-read-all-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  color: var(--accent);
  padding: 0;
}
.notif-read-all-btn:hover { text-decoration: underline; }

.notif-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-empty {
  padding: 24px;
  text-align: center;
  color: #999;
  font-size: .85rem;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(61,26,0,0.06);
  cursor: pointer;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(61,26,0,0.04); }
.notif-item.unread { background: rgba(61,26,0,0.03); }
.notif-item.unread .notif-item-title { font-weight: 600; }

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.notif-icon-task_assigned  { background: #e8f5e9; color: #2e7d32; }
.notif-icon-task_approved  { background: #e3f2fd; color: #1565c0; }
.notif-icon-task_rejected  { background: #fce4ec; color: #c62828; }
.notif-icon-log_reviewed   { background: #fff8e1; color: #f57f17; }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: .82rem;
  color: var(--brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-text {
  font-size: .78rem;
  color: #777;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.notif-item-time {
  font-size: .72rem;
  color: #aaa;
  margin-top: 4px;
}
/* ── end NA-86 ── */

/* Salary sub-tabs */
.salary-tabs { display:flex; border-bottom:1px solid #e0ddd8; background:#f8f6f2; }
.salary-tab { padding:10px 18px; border:none; border-bottom:2px solid transparent; background:none; cursor:pointer; color:#6b6358; font-size:13px; font-family:inherit; margin-bottom:-1px; white-space:nowrap; }
.salary-tab:hover { color:#2d2520; background:#f0ece6; }
.salary-tab.active { color:#2d5a9e; border-bottom-color:#2d5a9e; font-weight:500; background:#fff; }

/* Hide Chrome/Edge native password reveal button */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input::-webkit-credentials-auto-fill-button,
input::-webkit-strong-password-auto-fill-button {
  display: none !important;
}

/* ── General Ledger ── */
.coa-badge{display:inline-block;background:var(--accent-bg,#e8f0fd);color:var(--accent,#1d4ed8);font-size:11px;font-weight:600;padding:1px 6px;border-radius:3px;}
.je-ref{display:inline-block;background:#f5f0e8;color:#6b5b45;font-size:11px;padding:1px 5px;border-radius:3px;border:1px solid #ddd;white-space:nowrap;}
.gl-dr,.gl-cr,.gl-bal{text-align:right;white-space:nowrap;}
td.gl-dr{font-weight:500;}
td.gl-cr{color:#166534;font-weight:500;}
td.gl-bal{color:#1d4ed8;font-weight:500;}
.gl-acct{min-width:130px;max-width:170px;}
.gl-acct .coa-badge{display:block;margin-bottom:3px;}
.gl-acct .gl-acct-name{display:block;font-size:12px;word-break:normal;overflow-wrap:normal;}

/* CoA collapse + trash icon */
.coa-toggle-bar:hover { background: #f8f8f8; border-radius: 6px; }
.btn-icon-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #b91c1c;
  font-size: 1rem;
  padding: 4px 7px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.15s;
}
.btn-icon-del:hover { background: #fee2e2; }

/* CoA panel — compact width, matches other action-column tables */
#coa-panel-block { max-width: 520px; }
#coa-panel-block .panel-block-header { padding: .85rem 1.1rem; }
#coa-panel-block .panel-block-header .btn { padding: .4rem .8rem; font-size: .78rem; }
#coa-panel-block table { width: 100%; table-layout: fixed; }
#coa-panel-block th, #coa-panel-block td { padding: 9px 12px; font-size: .84rem; }
#coa-panel-block .coa-badge { font-size: 10px; padding: 2px 6px; }
#coa-panel-block th:last-child, #coa-panel-block td:last-child { width: 110px; padding-left: 16px; }
#coa-panel-block th:nth-child(3), #coa-panel-block td:nth-child(3) { width: 90px; }

/* GL account column — badge + name on one line, no mid-word wrap */

