:root{
  --bg: #f2f2f7;
  --card: rgba(255,255,255,0.88);
  --card-solid: #ffffff;
  --text: #0b0b0f;
  --muted: #6c6c73;
  --soft: #e5e5ea;
  --dark: #000000;
  --dark-2: #111111;
  --shadow: 0 18px 50px rgba(0,0,0,0.08);
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html, body{
  width:100%;
  min-height:100%;
}

body{
  font-family:'Inter', sans-serif;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.95), rgba(242,242,247,0.98) 45%, #eef0f5 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

button,
input{
  font-family:'Inter', sans-serif;
}

button{
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

#app-shell{
  width:100%;
  min-height:100vh;
}

#topbar{
  position:sticky;
  top:0;
  z-index:20;
  width:100%;
  max-width:740px;
  margin:0 auto;
  padding:18px 18px 14px;
  background:linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(12,12,14,0.98) 100%);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom-left-radius:24px;
  border-bottom-right-radius:24px;
  box-shadow:0 10px 30px rgba(0,0,0,0.16);
}

#top-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

#logo-box{
  width:46px;
  height:46px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  flex:0 0 auto;
}

#logo-box ion-icon{
  font-size:21px;
}

.title-wrap{
  min-width:0;
}

#eyebrow{
  font-size:11px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  opacity:0.62;
  margin-bottom:4px;
}

#page-title{
  font-size:18px;
  font-weight:700;
  line-height:1.1;
}

#profile-btn{
  width:42px;
  height:42px;
  border:none;
  background:rgba(255,255,255,0.08);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  backdrop-filter:blur(12px);
}

#container{
  width:100%;
  max-width:740px;
  margin:0 auto;
  padding:18px 18px 120px;
}

#stats{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin-top:2px;
}

.stat-card{
  background:var(--card);
  border:1px solid rgba(255,255,255,0.7);
  backdrop-filter:blur(16px);
  padding:16px;
  border-radius:var(--radius-xl);
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow:var(--shadow-soft);
}

.stat-icon{
  width:50px;
  height:50px;
  background:#0b0b0f;
  color:#fff;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.stat-icon .material-icons{
  font-size:23px;
}

.stat-info{
  min-width:0;
}

.stat-label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:4px;
}

.stat-info h2{
  font-size:24px;
  line-height:1;
  font-weight:800;
  letter-spacing:-0.03em;
}

#actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}

.action-btn{
  height:54px;
  border:none;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:700;
  font-size:13px;
  box-shadow:var(--shadow-soft);
}

.light-btn{
  background:rgba(255,255,255,0.88);
  color:#111;
  border:1px solid rgba(0,0,0,0.06);
}

.dark-btn{
  background:#0b0b0f;
  color:#fff;
}

.action-btn .material-icons{
  font-size:19px;
}

#course-head{
  margin-top:24px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
}

.section-kicker{
  font-size:11px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:5px;
}

#course-head h3{
  font-size:19px;
  line-height:1.1;
  letter-spacing:-0.02em;
}

#course-total{
  background:#0b0b0f;
  color:#fff;
  min-width:36px;
  height:30px;
  padding:0 12px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
}

#courses{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.course-item{
  background:var(--card);
  border:1px solid rgba(255,255,255,0.7);
  backdrop-filter:blur(16px);
  border-radius:var(--radius-xl);
  padding:16px;
  box-shadow:var(--shadow-soft);
}

.course-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.course-code{
  font-size:16px;
  font-weight:800;
  letter-spacing:-0.02em;
  line-height:1.2;
}

.course-lecturer{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.course-status{
  flex:0 0 auto;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid transparent;
}

.course-status.open{
  background:#0b0b0f;
  color:#fff;
}

.course-status.closed{
  background:#ececf1;
  color:#0b0b0f;
  border-color:#dedee6;
}

.floating-btn{
  position:fixed;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  width:calc(100% - 36px);
  max-width:704px;
  height:58px;
  background:#0b0b0f;
  color:#fff;
  border:none;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:14px;
  font-weight:700;
  box-shadow:0 18px 40px rgba(0,0,0,0.22);
  z-index:30;
}

.floating-btn .material-icons{
  font-size:20px;
}

#overlay{
  position:fixed;
  inset:0;
  background:rgba(10,10,12,0.52);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  display:none;
  z-index:90;
}

.modal{
  position:fixed;
  left:50%;
  bottom:16px;
  transform:translateX(-50%) translateY(18px);
  width:calc(100% - 24px);
  max-width:420px;
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(255,255,255,0.75);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border-radius:30px;
  padding:18px;
  z-index:100;
  display:none;
  box-shadow:0 24px 70px rgba(0,0,0,0.24);
}

.modal-handle{
  width:42px;
  height:5px;
  border-radius:999px;
  background:#d1d1d6;
  margin:0 auto 14px;
}

.modal-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.modal-top h3,
.week-copy h3{
  font-size:18px;
  line-height:1.15;
  letter-spacing:-0.02em;
}

.modal-kicker{
  font-size:11px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:4px;
}

.close-modal{
  width:38px;
  height:38px;
  border:none;
  background:#ececf1;
  color:#0b0b0f;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.close-modal .material-icons{
  font-size:20px;
}

#pin-value{
  margin-top:22px;
  font-size:40px;
  font-weight:800;
  text-align:center;
  letter-spacing:0.14em;
  line-height:1;
}

.modal-note{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
  line-height:1.5;
}

.modal-primary-btn{
  margin-top:16px;
  width:100%;
  height:52px;
  border:none;
  background:#0b0b0f;
  color:#fff;
  border-radius:16px;
  font-weight:700;
  font-size:14px;
  box-shadow:0 12px 24px rgba(0,0,0,0.16);
}

.week-icon{
  width:58px;
  height:58px;
  background:#0b0b0f;
  color:#fff;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 14px;
}

.week-icon .material-icons{
  font-size:26px;
}

.week-copy{
  text-align:center;
}

#week{
  width:100%;
  height:54px;
  margin-top:16px;
  border:1px solid #d7d7de;
  background:#fff;
  border-radius:16px;
  padding:0 16px;
  font-size:14px;
  outline:none;
  color:#111;
}

#week::placeholder{
  color:#a1a1aa;
}

#week:focus{
  border-color:#0b0b0f;
  box-shadow:0 0 0 4px rgba(0,0,0,0.06);
}

@media (min-width: 700px){
  #stats{
    grid-template-columns:repeat(3, 1fr);
  }
}

@media (max-width: 600px){
  #actions{
    grid-template-columns:1fr;
  }

  #page-title{
    font-size:17px;
  }

  .course-top{
    align-items:center;
  }
}