:root{
  --bg:#f7f6f2;
  --panel:#ffffff;
  --panel-soft:#fbfaf7;
  --text:#1f2e43;
  --muted:#7d8794;
  --line:#ece7db;
  --gold:#d4a326;
  --gold-dark:#b98915;
  --gold-soft:#fbf4df;
  --navy:#24364f;
  --green:#2f9a68;
  --green-soft:#eaf8f1;
  --red:#d9534f;
  --red-soft:#fdeeee;
  --blue:#345db8;
  --blue-soft:#eef4ff;
  --shadow:0 10px 30px rgba(31,46,67,.08);
}

*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  font-family:Inter, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}
body{min-height:100vh}
a{text-decoration:none;color:inherit}
button,input,textarea{font-family:inherit}

.profile-screen{
  min-height:100vh;
  padding:18px 14px calc(92px + env(safe-area-inset-bottom));
}
.profile-app{
  width:100%;
  max-width:430px;
  margin:0 auto;
}

.top-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}
.mini-text{
  margin:0 0 4px;
  font-size:12px;
  font-weight:700;
  color:var(--gold-dark);
}
.top-header h1{
  margin:0 0 4px;
  font-size:28px;
  color:var(--navy);
}
.sub-text{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.profile-badge{
  width:52px;
  height:52px;
  border:none;
  border-radius:18px;
  background:linear-gradient(180deg,var(--gold),var(--gold-dark));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  font-weight:800;
  box-shadow:var(--shadow);
}

.profile-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:26px;
  padding:16px;
  box-shadow:var(--shadow);
  margin-bottom:14px;
}
.profile-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.avatar-wrap{
  display:flex;
  align-items:center;
  gap:12px;
}
.avatar-circle{
  width:64px;
  height:64px;
  border-radius:20px;
  background:linear-gradient(180deg,var(--gold),var(--gold-dark));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  font-weight:900;
  box-shadow:var(--shadow);
}
.avatar-wrap h2{
  margin:0 0 4px;
  font-size:20px;
  color:var(--navy);
}
.avatar-wrap p{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.edit-btn{
  border:none;
  background:var(--gold-soft);
  color:var(--gold-dark);
  padding:10px 14px;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
}

.profile-info-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}
.info-box{
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px 12px;
}
.info-box span{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
}
.info-box strong{
  font-size:14px;
  color:var(--navy);
  line-height:1.4;
  word-break:break-word;
}

.summary-strip{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-bottom:16px;
}
.summary-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px 12px;
  box-shadow:var(--shadow);
  text-align:center;
}
.summary-card p{
  margin:0 0 8px;
  color:var(--muted);
  font-size:12px;
}
.summary-card h3{
  margin:0;
  color:var(--navy);
  font-size:20px;
}

.section-block{
  margin-bottom:16px;
}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.section-mini{
  margin:0 0 4px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.section-head h3{
  margin:0;
  font-size:22px;
  color:var(--navy);
}

.course-progress-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.progress-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  padding:14px;
  box-shadow:var(--shadow);
}
.progress-card-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.progress-card-title{
  margin:0 0 4px;
  font-size:16px;
  color:var(--navy);
  line-height:1.3;
}
.progress-card-meta{
  margin:0;
  font-size:12px;
  color:var(--muted);
}
.progress-status{
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.status-active{
  background:var(--green-soft);
  color:var(--green);
}
.status-pending{
  background:var(--red-soft);
  color:var(--red);
}
.status-completed{
  background:var(--blue-soft);
  color:var(--blue);
}

.fee-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:8px 0 10px;
  font-size:12px;
  color:var(--muted);
}
.progress-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  font-size:12px;
  color:var(--muted);
}
.progress-track{
  width:100%;
  height:10px;
  border-radius:999px;
  background:#eee7d7;
  overflow:hidden;
}
.progress-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--gold),var(--gold-dark));
}

.bottom-nav{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width:100%;
  max-width:430px;
  background:#fff;
  border-top:1px solid var(--line);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  padding:10px 8px calc(10px + env(safe-area-inset-bottom));
  box-shadow:0 -8px 24px rgba(31,46,67,.06);
}
.nav-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:var(--muted);
}
.nav-item span{font-size:20px}
.nav-item small{
  font-size:11px;
  font-weight:700;
}
.nav-item.active{
  color:var(--gold-dark);
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(20,24,34,.45);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:16px;
  z-index:999;
}
.hidden{display:none!important}

.profile-modal-card{
  width:100%;
  max-width:430px;
  background:#fff;
  border-radius:28px;
  padding:18px;
  box-shadow:var(--shadow);
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:16px;
}
.modal-head h3{
  margin:0;
  font-size:22px;
  color:var(--navy);
}
.modal-close{
  border:none;
  background:#f3f4f8;
  width:40px;
  height:40px;
  border-radius:12px;
  font-size:16px;
  cursor:pointer;
}
.modal-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.form-group{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.form-group label{
  font-size:13px;
  font-weight:700;
  color:var(--navy);
}
.form-group input,
.form-group textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:13px 14px;
  font-size:14px;
  outline:none;
  background:#fff;
}
.form-group textarea{
  resize:none;
}
.primary-btn.full-btn{
  width:100%;
  border:none;
  background:linear-gradient(180deg,var(--gold),var(--gold-dark));
  color:#fff;
  padding:14px;
  border-radius:16px;
  font-size:15px;
  font-weight:800;
  cursor:pointer;
}

@media (max-width:420px){
  .profile-info-grid{
    grid-template-columns:1fr;
  }
  .summary-strip{
    grid-template-columns:1fr;
  }
  .top-header h1{
    font-size:26px;
  }
}