*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;background:#f5f7fb;color:#18212f}.app{display:flex;min-height:100vh}.sidebar{width:250px;background:#111827;color:#dbe4f0;padding:22px 14px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.brand{display:flex;gap:12px;align-items:center;padding:6px 10px 28px}.brand-mark{width:38px;height:38px;border-radius:11px;background:#2563eb;color:#fff;display:grid;place-items:center;font-weight:800}.brand b{display:block;color:#fff}.brand small{color:#94a3b8}.nav-item{display:flex;gap:12px;align-items:center;text-decoration:none;color:#aebbd0;padding:12px 13px;border-radius:10px;margin:3px 0;font-size:14px}.nav-item:hover,.nav-item.active{background:#1e293b;color:#fff}.sidebar-footer{margin-top:auto;color:#718096;font-size:12px;padding:12px}.main{margin-left:250px;width:calc(100% - 250px)}.topbar{height:82px;background:#fff;border-bottom:1px solid #e7ebf2;padding:17px 30px;display:flex;justify-content:space-between;align-items:center}.topbar h1{font-size:22px;margin:0}.topbar p{margin:4px 0 0;color:#7b8798;font-size:13px}.admin-chip{display:flex;gap:9px;align-items:center}.avatar{width:35px;height:35px;border-radius:50%;background:#e8efff;color:#2563eb;display:grid;place-items:center;font-weight:700}.admin-chip b,.admin-chip small{display:block}.admin-chip small{font-size:11px;color:#8a96a7}.content{padding:28px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.card{background:#fff;border:1px solid #e8edf4;border-radius:15px;padding:20px;box-shadow:0 2px 10px #16213d08}.metric{font-size:27px;font-weight:750;margin-top:10px}.muted{color:#8792a4;font-size:13px}.card-icon{float:right;width:40px;height:40px;border-radius:11px;background:#eef4ff;display:grid;place-items:center;color:#2563eb}.section{margin-top:22px}.section-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}.section-head h2{font-size:16px}.btn{border:0;border-radius:9px;padding:10px 15px;font-weight:650;cursor:pointer}.primary{background:#2563eb;color:white}.ghost{background:#eef1f6;color:#334155}.table-wrap{background:#fff;border:1px solid #e8edf4;border-radius:14px;overflow:auto}.table{width:100%;border-collapse:collapse;font-size:13px}.table th,.table td{padding:13px 15px;border-bottom:1px solid #edf0f4;text-align:left;white-space:nowrap}.table th{background:#fafbfc;color:#697586;font-weight:650}.badge{padding:5px 9px;border-radius:20px;font-size:11px;font-weight:700}.badge.active{background:#dcfce7;color:#15803d}.badge.training{background:#fff7d6;color:#9a6700}.badge.inactive,.badge.left{background:#eef1f5;color:#64748b}.empty{padding:35px;text-align:center;color:#8b96a7}.modal{position:fixed;inset:0;background:#0f172a88;display:grid;place-items:center;padding:20px;z-index:20}.hidden{display:none}.modal-card{width:min(760px,100%);background:#fff;border-radius:16px;box-shadow:0 20px 70px #0003;padding:22px}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.modal-head h2{margin:0;font-size:18px}.modal-head button{border:0;background:transparent;font-size:27px;cursor:pointer}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}label{display:block;font-size:12px;font-weight:650;color:#556274;margin-bottom:12px}input,select,textarea{width:100%;margin-top:7px;border:1px solid #dbe1ea;border-radius:9px;padding:10px 11px;font:inherit;font-size:13px;outline:none}input:focus,select:focus,textarea:focus{border-color:#5b8def;box-shadow:0 0 0 3px #2563eb12}textarea{min-height:80px;resize:vertical}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:10px}.quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.quick{padding:20px;border:1px dashed #cdd6e3;border-radius:14px;background:#fff}.quick h3{margin:0 0 6px;font-size:15px}.quick p{margin:0;color:#7b8798;font-size:12px}@media(max-width:900px){.sidebar{width:70px}.brand div,.nav-item span,.sidebar-footer{display:none}.main{margin-left:70px;width:calc(100% - 70px)}.cards{grid-template-columns:1fr 1fr}.quick-grid{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}}@media(max-width:560px){.cards{grid-template-columns:1fr}.content{padding:16px}.topbar{padding:14px 16px}.admin-chip div{display:none}}

.login-body{min-height:100vh;background:linear-gradient(135deg,#eef4ff,#f7f8fb);display:grid;place-items:center;padding:20px}
.login-shell{width:min(420px,100%)}
.login-card{background:#fff;border:1px solid #e4e9f1;border-radius:20px;padding:34px;box-shadow:0 18px 60px #17255412}
.login-logo{width:52px;height:52px;border-radius:15px;background:#2563eb;color:#fff;display:grid;place-items:center;font-size:22px;font-weight:800;margin-bottom:20px}
.login-card h1{margin:0;font-size:25px}.login-card>p{color:#7b8798;margin:7px 0 26px;font-size:13px}
.login-btn{width:100%;margin-top:5px;padding:12px}.login-error{color:#dc2626;font-size:12px;min-height:18px;margin:2px 0 5px}.login-footer{text-align:center;color:#9aa4b2;font-size:11px;margin-top:25px}
.logout-btn{padding:7px 10px;font-size:11px;margin-left:8px}

@media(max-width:700px){
  .topbar{height:auto;min-height:72px;gap:10px}
  .topbar h1{font-size:19px}
  .topbar p{font-size:12px}
  .admin-chip .logout-btn{margin-left:3px}
}
@media(max-width:480px){
  .admin-chip .avatar{width:32px;height:32px}
  .logout-btn{font-size:10px!important;padding:6px 8px!important}
}

.employee-modal{max-height:92vh;overflow:auto}
.modal-subtitle{font-size:12px;color:#8792a4;margin-top:4px}
.form-section{padding:16px 0;border-bottom:1px solid #edf0f4}
.form-section:first-of-type{padding-top:0}
.form-section:last-of-type{border-bottom:0}
.form-section-title{font-size:13px;font-weight:750;color:#263247;margin-bottom:13px}
.info-note{padding:10px 12px;background:#f5f8ff;border:1px solid #e1eaff;border-radius:9px;color:#64748b;font-size:11px;line-height:1.5;margin-top:2px}
.training-field.is-hidden{display:none}
@media(max-width:600px){
  .employee-modal{max-height:94vh;padding:18px}
  .modal-subtitle{max-width:260px;line-height:1.4}
}

/* ===== Employee modal scrolling fix ===== */
.modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  overflow-y:auto;
  padding:28px 20px;
  background:rgba(15,23,42,.55);
  -webkit-overflow-scrolling:touch;
}

.modal.hidden{
  display:none;
}

.modal-card.employee-modal{
  width:min(760px,100%);
  max-height:calc(100vh - 56px);
  max-height:calc(100dvh - 56px);
  overflow-y:auto;
  overflow-x:hidden;
  margin:auto 0;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

.employee-modal .modal-head{
  position:sticky;
  top:-22px;
  z-index:5;
  background:#fff;
  padding-top:2px;
  padding-bottom:12px;
}

@media(max-width:600px){
  .modal{
    padding:10px;
  }

  .modal-card.employee-modal{
    max-height:calc(100vh - 20px);
    max-height:calc(100dvh - 20px);
    border-radius:14px;
  }

  .employee-modal .modal-head{
    top:-18px;
  }
}

/* Visible scrollbar on desktop */
.modal-card.employee-modal::-webkit-scrollbar{
  width:8px;
}
.modal-card.employee-modal::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:10px;
}
.modal-card.employee-modal::-webkit-scrollbar-track{
  background:transparent;
}
