:root{
  --deep-green:#064E3B; --green-2:#043C2E; --gold:#C69B3C; --gold-dark:#A5792B;
  --bg:#F5F7F5; --surface:#FFFFFF; --ink:#18251F; --muted:#66756C;
  --line:#E5EBE6; --danger:#B3453B; --ok:#1C8A5C;
  --shadow:0 1px 2px rgba(6,78,59,0.05), 0 2px 6px rgba(6,78,59,0.04);
  --radius:10px;
}
body.dark{
  --bg:#0e1512; --surface:#161f1b; --ink:#eef2ef; --muted:#8fa199;
  --line:#26332d; --shadow:0 1px 2px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.2);
}
*{box-sizing:border-box;}
body{margin:0; font-family:'Inter',sans-serif; background:var(--bg); color:var(--ink); transition:background .2s,color .2s;}
.hidden{display:none !important;}
a{color:inherit;}

#loadingScreen{
  position:fixed; inset:0; background:var(--deep-green); z-index:999;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px;
  transition:opacity .4s ease;
}
#loadingScreen .lcrest{width:64px; height:64px; border-radius:50%; border:2px solid var(--gold); display:flex; align-items:center; justify-content:center; overflow:hidden;}
#loadingScreen .lcrest img{width:100%; height:100%; object-fit:cover; border-radius:50%;}
.spinner{width:26px; height:26px; border:3px solid rgba(201,162,75,0.25); border-top-color:var(--gold); border-radius:50%; animation:spin 0.8s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}
#loadingScreen p{color:#e8f0eb; font-size:13px; letter-spacing:0.5px; font-weight:500;}

.spinner-btn{width:15px; height:15px; border:2.5px solid rgba(255,255,255,0.35); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; display:none;}
.btn.loading .spinner-btn{display:inline-block;}
.btn.loading .btn-label{display:none;}
.btn[disabled]{opacity:0.7; cursor:wait;}

#toastContainer{position:fixed; top:16px; left:0; right:0; z-index:1000; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none;}
.toast{background:var(--surface); color:var(--ink); border-radius:10px; padding:11px 18px; box-shadow:var(--shadow); font-size:13px; font-weight:600; max-width:92%; display:flex; align-items:center; gap:8px; border-left:4px solid var(--ok); animation:toastIn .25s ease; pointer-events:auto;}
.toast.error{border-left-color:var(--danger);}
.toast.info{border-left-color:var(--gold-dark);}
@keyframes toastIn{from{transform:translateY(-12px); opacity:0;} to{transform:translateY(0); opacity:1;}}

.home-header{background:var(--deep-green); padding:26px 20px 22px; text-align:center; color:#fff; position:relative; overflow:hidden;}
.home-header::before{
  content:""; position:absolute; top:-60px; right:-60px; width:220px; height:220px;
  border:1.5px solid rgba(201,162,75,0.12); border-radius:50%;
}
.home-header::after{
  content:""; position:absolute; bottom:-90px; left:-90px; width:260px; height:260px;
  border:1.5px solid rgba(201,162,75,0.08); border-radius:50%;
}
.dark-toggle{position:absolute; top:16px; right:16px; background:rgba(255,255,255,0.12); border:none; color:#fff; width:36px; height:36px; border-radius:50%; font-size:15px; cursor:pointer;}
.logo-row{display:flex; align-items:center; justify-content:center; gap:16px; margin-bottom:14px;}
.logo-circle{width:54px; height:54px; border-radius:50%; border:1.5px solid rgba(201,162,75,0.6); display:flex; align-items:center; justify-content:center; font-size:22px; color:var(--gold); background:rgba(255,255,255,0.06); overflow:hidden;}
.logo-circle img{width:100%; height:100%; object-fit:cover; border-radius:50%;}
.home-header .org{font-size:10px; letter-spacing:2px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:3px;}
.home-header .campus{font-size:11px; color:rgba(255,255,255,0.65); margin-bottom:14px;}
.home-header h1{font-size:20px; font-weight:800; margin:0 0 8px;}
.home-header .desc{font-size:12.5px; color:rgba(255,255,255,0.75); max-width:320px; margin:0 auto 10px; line-height:1.5;}
.session-badge{display:inline-block; background:rgba(201,162,75,0.18); border:1px solid rgba(201,162,75,0.4); color:var(--gold); font-size:11px; font-weight:700; padding:4px 12px; border-radius:20px;}

.container{max-width:460px; margin:0 auto; padding:20px 18px 10px;}

.card{background:var(--surface); border-radius:var(--radius); margin-bottom:16px; box-shadow:var(--shadow); overflow:hidden; border:1px solid var(--line);}
.card-head{padding:16px 18px 4px; display:flex; justify-content:space-between; align-items:center;}
.card-head .t{font-size:13px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:8px;}
.card-body{padding:16px 18px;}

label{display:block; font-size:11.5px; font-weight:700; color:var(--muted); margin-bottom:6px;}
input, select, textarea{width:100%; border:1.5px solid var(--line); border-radius:10px; padding:12px 14px; font-size:14px; font-family:inherit; color:var(--ink); background:var(--bg); margin-bottom:14px; transition:border-color .15s, box-shadow .15s;}
input:focus, select:focus, textarea:focus{outline:none; border-color:var(--gold-dark); box-shadow:0 0 0 3px rgba(166,124,46,0.12);}
select{appearance:none; -webkit-appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7A72' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-right:36px;}

.pw-wrap{position:relative;}
.pw-wrap input{padding-right:46px;}
.pw-toggle{position:absolute; right:4px; top:4px; bottom:18px; width:38px; background:none; border:none; cursor:pointer; font-size:16px; color:var(--muted); display:flex; align-items:center; justify-content:center;}

.btn{background:var(--deep-green); color:#fff; border:none; border-radius:10px; padding:13px; font-size:13px; font-weight:700; cursor:pointer; width:100%; font-family:inherit; display:flex; align-items:center; justify-content:center; gap:8px; text-decoration:none;}
.btn-gold{background:var(--gold); color:#18251F;}
.btn-outline{background:transparent; border:1.5px solid var(--deep-green); color:var(--deep-green);}
body.dark .btn-outline{color:#9fd6bb; border-color:#9fd6bb;}
.btn-danger{background:var(--danger); color:#fff;}

.notice{font-size:12px; line-height:1.5; color:var(--muted); background:var(--bg); border-left:3px solid var(--gold); padding:10px 12px; border-radius:8px; margin-bottom:16px;}
.error-msg{color:var(--danger); font-size:12px; margin-top:-8px; margin-bottom:12px; font-weight:600;}

.exec-link-wrap{text-align:center; padding:6px 0 20px;}
.exec-link{font-size:11.5px; color:var(--muted); background:none; border:none; cursor:pointer; text-decoration:underline; text-underline-offset:3px; font-family:inherit;}

.link-row{display:flex; justify-content:center; gap:10px; padding:4px 0 20px; flex-wrap:wrap;}
.pill-link{
  font-size:11.5px; font-weight:600; color:var(--muted); background:var(--surface);
  border:1px solid var(--line); border-radius:20px; padding:8px 16px; cursor:pointer;
  font-family:inherit; text-decoration:none; display:inline-flex; align-items:center; gap:6px;
  box-shadow:var(--shadow);
}
.pill-link:active{opacity:0.8;}

.user-badge{display:flex; align-items:center; justify-content:space-between; padding:16px 18px;}
.user-badge .who{font-size:10.5px; color:var(--muted); text-transform:uppercase; letter-spacing:0.4px;}
.user-badge .who strong{display:block; font-size:15px; color:var(--ink); text-transform:none; margin-top:2px; font-weight:700;}
.logout{font-size:11px; color:var(--danger); border:1.5px solid var(--danger); padding:6px 12px; border-radius:8px; cursor:pointer; background:none; font-family:inherit; font-weight:700; text-decoration:none;}

.member-row{display:flex; align-items:center; justify-content:space-between; padding:12px 18px; border-top:1px solid var(--line);}
.member-name{font-size:13px; font-weight:700;}
.member-phone{font-size:11px; color:var(--muted); font-family:monospace;}
.send-btn{background:var(--ok); color:#fff; border:none; border-radius:8px; padding:7px 14px; font-size:11px; font-weight:700; cursor:pointer; font-family:inherit;}
.sent{background:var(--line); color:var(--muted);}
.char-count{font-size:10.5px; color:var(--muted); text-align:right; margin-top:-10px; margin-bottom:14px;}

.empty-state{text-align:center; padding:34px 20px; color:var(--muted);}
.empty-state .icon{font-size:30px; margin-bottom:10px; opacity:0.6;}
.empty-state p{font-size:12.5px; margin:0;}

.app-layout{display:flex; min-height:100vh;}
.sidebar{width:72px; background:var(--deep-green); display:flex; flex-direction:column; align-items:center; padding:18px 0; gap:6px; flex-shrink:0;}
.sidebar .side-logo{width:34px; height:34px; border-radius:50%; border:1px solid var(--gold); display:flex; align-items:center; justify-content:center; margin-bottom:14px; overflow:hidden;}
.sidebar .side-logo img{width:100%; height:100%; object-fit:cover; border-radius:50%;}
.side-btn{width:52px; height:52px; border-radius:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:rgba(255,255,255,0.55); font-size:19px; gap:2px; cursor:pointer; background:none; border:none; font-family:inherit; text-decoration:none;}
.side-btn span.lbl{font-size:8px; font-weight:700; letter-spacing:0.3px;}
.side-btn.active{background:rgba(201,162,75,0.18); color:var(--gold);}
.side-btn.logout-btn{margin-top:auto; color:rgba(255,255,255,0.4);}

.admin-main{flex:1; padding:20px 18px 40px; max-width:520px;}
.admin-topbar{display:flex; justify-content:space-between; align-items:center; margin-bottom:18px;}
.admin-topbar h2{font-size:17px; margin:0; font-weight:800;}
.admin-topbar .role-pill{font-size:10.5px; background:var(--surface); border:1px solid var(--line); padding:5px 12px; border-radius:20px; color:var(--muted); font-weight:700;}

.stat-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px;}
.stat-box{background:var(--surface); border-radius:var(--radius); padding:16px 14px; box-shadow:var(--shadow); border:1px solid var(--line); color:var(--ink);}
.stat-box .icon{font-size:18px; margin-bottom:8px;}
.stat-box .num{font-size:22px; font-weight:800; color:var(--ink);}
.stat-box .lbl{font-size:10.5px; color:var(--muted); font-weight:600; margin-top:2px;}

.class-row{display:flex; justify-content:space-between; align-items:center; padding:13px 18px; border-top:1px solid var(--line); flex-wrap:wrap; gap:8px;}
.class-name{font-size:13px; font-weight:700;}
.progress-wrap{width:100px;}
.progress-bar{background:var(--line); border-radius:10px; height:6px; overflow:hidden; margin-bottom:3px;}
.progress-fill{background:var(--ok); height:100%; transition:width .3s;}
.progress-txt{font-size:9.5px; color:var(--muted); text-align:right; font-weight:600;}
.edit-icons{display:flex; gap:6px; flex-wrap:wrap;}
.icon-btn{border:1.5px solid var(--line); border-radius:8px; padding:5px 10px; color:var(--ink); background:var(--bg); cursor:pointer; font-size:10px; font-weight:700; font-family:inherit;}
.icon-btn.danger{color:var(--danger); border-color:var(--danger);}

.paste-hint{font-size:11px; color:var(--muted); line-height:1.5; margin-bottom:8px;}
.parsed-list{border:1.5px solid var(--line); border-radius:10px; background:var(--bg); overflow:hidden; margin-bottom:14px;}
.parsed-row{display:flex; align-items:center; gap:10px; padding:9px 12px; border-top:1px solid var(--line);}
.parsed-row:first-child{border-top:none;}
.pname{font-size:12px; font-weight:700; display:block;}
.pphone{font-size:10px; color:var(--muted); font-family:monospace; display:block;}

.footer-note{text-align:center; font-size:10.5px; color:var(--muted); padding:12px 20px 16px; line-height:1.55;}
.footer-note strong{display:block; color:var(--ink); font-size:11px; margin-bottom:2px;}

.tabs{display:flex; margin-bottom:16px; background:var(--surface); border-radius:12px; padding:4px; box-shadow:var(--shadow);}
.tabbtn{flex:1; text-align:center; padding:11px; background:transparent; color:var(--muted); font-size:12.5px; font-weight:700; border:none; border-radius:9px; cursor:pointer; font-family:inherit;}
.tabbtn.active{background:var(--deep-green); color:#fff;}

.guide-step{display:flex; gap:12px; padding:14px 0; border-top:1px solid var(--line);}
.guide-step:first-child{border-top:none;}
.guide-num{width:30px; height:30px; border-radius:50%; background:var(--deep-green); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0;}
.guide-text{font-size:13px; color:var(--ink); line-height:1.5; padding-top:3px;}
.guide-text strong{display:block; margin-bottom:2px; color:var(--deep-green); font-size:13.5px;}
body.dark .guide-text strong{color:#9fd6bb;}

.welcome-overlay{position:fixed; inset:0; background:rgba(10,61,46,0.75); z-index:900; display:flex; align-items:center; justify-content:center; padding:20px;}
.welcome-card{background:var(--surface); border-radius:18px; max-width:420px; width:100%; max-height:85vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,0.3);}
.welcome-header{background:var(--deep-green); padding:24px 20px; text-align:center; border-radius:18px 18px 0 0;}
.welcome-header h2{color:#fff; margin:0 0 4px; font-size:19px; font-family:Georgia,serif;}
.welcome-header p{color:var(--gold); margin:0; font-size:12px;}

/* ---------- Login: editorial hero + tab switcher (v4 design) ---------- */
.login-ring-deco{position:absolute; width:260px; height:260px; border:1px solid rgba(201,162,75,0.18); border-radius:50%; top:-130px; right:-90px; pointer-events:none;}
.login-ring-deco::after{content:""; position:absolute; inset:28px; border:1px solid rgba(201,162,75,0.14); border-radius:50%;}
.login-panel{background:var(--surface); border-radius:22px 22px 0 0; margin-top:-18px; padding-top:22px; position:relative;}
.tab-row{display:flex; background:var(--bg); border-radius:10px; padding:3px; margin:0 18px 20px;}
.tab{flex:1; text-align:center; padding:10px 6px; border-radius:8px; font-size:12.5px; font-weight:700; color:var(--muted); cursor:pointer; border:none; background:none; font-family:'Inter',sans-serif;}
.tab.active{background:var(--deep-green); color:#fff;}

/* ---------- Compact class progress card grid ---------- */
#fullClassList{display:grid; grid-template-columns:1fr; gap:8px; padding:4px 14px 14px;}
@media (min-width:380px){ #fullClassList{grid-template-columns:1fr 1fr;} }
.class-card{
  background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:10px 11px;
  text-decoration:none; color:inherit; display:block; min-width:0;
}
.class-card .cc-top{display:flex; justify-content:space-between; align-items:flex-start; gap:6px;}
.class-card .cc-name{font-size:12.5px; font-weight:700; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;}
.class-card .cc-pct{font-size:13px; font-weight:800; color:var(--deep-green); flex-shrink:0;}
body.dark .class-card .cc-pct{color:var(--gold);}
.class-card .cc-pct.complete{color:var(--ok);}
.class-card .progress-bar{height:5px; margin:7px 0 7px;}
.class-card .cc-stats{display:flex; flex-wrap:wrap; gap:4px 10px; font-size:10px; color:var(--muted); font-weight:600;}
.class-card .cc-stats b{color:var(--ink); font-weight:700;}
body.dark .class-card .cc-stats b{color:var(--surface);}

/* ---------- Bento hero card (v4 design — gradient + ring) ---------- */
.bento-exec{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:22px;}
.bento-exec .big-card{
  grid-column:span 2; background:linear-gradient(120deg, var(--deep-green), var(--green-2));
  border-radius:16px; padding:18px; color:#fff; display:flex; justify-content:space-between; align-items:center;
}
.bento-exec .big-card .num{font-size:30px; font-weight:900;}
.bento-exec .big-card .lbl{font-size:11px; color:var(--gold); font-weight:700; margin-top:2px; letter-spacing:0.3px;}
.bento-exec .ring-mini{
  width:58px; height:58px; border-radius:50%; display:flex; align-items:center; justify-content:center; position:relative; flex-shrink:0;
}
.bento-exec .ring-mini::after{content:""; position:absolute; inset:6px; background:var(--green-2); border-radius:50%;}
.bento-exec .ring-mini span{position:relative; font-size:12px; font-weight:800; color:#fff;}
.bento-exec .exec-stat{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px;}
.bento-exec .exec-stat .num{font-size:22px; font-weight:800; color:var(--deep-green);}
body.dark .bento-exec .exec-stat .num{color:var(--gold);}
.bento-exec .exec-stat .lbl{font-size:11px; color:var(--muted); margin-top:3px; font-weight:600;}

/* ---------- Overall progress ring (Executive dashboard) ---------- */
.ring-summary{display:flex; flex-direction:column; gap:10px; margin-bottom:18px;}
.ring-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:20px; display:flex; align-items:center; gap:18px; color:var(--ink);
}
.ring{
  width:84px; height:84px; border-radius:50%; flex-shrink:0; position:relative;
  display:flex; align-items:center; justify-content:center;
}
.ring::after{content:""; position:absolute; inset:9px; background:var(--surface); border-radius:50%;}
.ring span{position:relative; font-size:17px; font-weight:800; color:var(--deep-green);}
body.dark .ring span{color:var(--gold);}
.ring-card .ring-label{font-size:12.5px; font-weight:700; color:var(--muted);}
.ring-card .ring-sub{font-size:19px; font-weight:800; margin-top:3px; color:var(--ink);}
.mini-stat-row{display:flex; gap:10px;}
.mini-stat-row .stat-box{flex:1;}
@media (min-width:600px){
  .ring-summary{flex-direction:row; align-items:stretch;}
  .ring-card{flex:1.2;}
  .mini-stat-row{flex:1; flex-direction:column;}
}

/* ---------- Member list status filter pills ---------- */
.filter-pill{
  flex:1; padding:8px 4px; border-radius:9px; border:1.5px solid var(--line); background:var(--surface);
  color:var(--muted); font-family:'Inter',sans-serif; font-size:12px; font-weight:700; cursor:pointer;
}
.filter-pill.active{background:var(--deep-green); border-color:var(--deep-green); color:#fff;}

/* ---------- Mobile nav drawer ---------- */
.hamburger-btn{
  display:none; width:38px; height:38px; border-radius:10px; background:var(--surface);
  border:1px solid var(--line); font-size:16px; align-items:center; justify-content:center;
  margin-right:10px; flex-shrink:0; cursor:pointer; color:var(--ink);
}
.drawer-overlay{display:none; position:fixed; inset:0; background:rgba(4,20,14,0.5); z-index:290;}
.drawer-overlay.show{display:block;}

@media (max-width:879px){
  .hamburger-btn{display:flex;}
  .admin-topbar{align-items:center;}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0; width:230px; z-index:300;
    transform:translateX(-100%); transition:transform 0.22s ease;
    padding:20px 14px; align-items:stretch; box-shadow:4px 0 20px rgba(0,0,0,0.2);
  }
  .sidebar.open{transform:translateX(0);}
  .sidebar .side-btn{
    flex-direction:row; justify-content:flex-start; gap:12px; padding:11px 12px;
    width:100%; height:auto; font-size:16px; border-radius:9px;
  }
  .sidebar .side-btn span.lbl{font-size:13.5px; font-weight:600; letter-spacing:0;}
}

/* ---------- Responsive sidebar: icon-only on phones, labeled on wider screens ---------- */
@media (min-width:880px){
  .sidebar{
    width:216px; align-items:stretch; padding:22px 14px; gap:4px;
  }
  .sidebar .side-logo{align-self:center; width:40px; height:40px; margin-bottom:18px;}
  .side-btn{
    width:100%; height:auto; flex-direction:row; justify-content:flex-start; gap:12px;
    padding:11px 12px; font-size:16px; border-radius:9px;
  }
  .side-btn span.lbl{font-size:13px; font-weight:600; letter-spacing:0;}
  .admin-main{max-width:720px; padding:28px 32px 48px;}
  .stat-grid{grid-template-columns:repeat(4,1fr);}
}
@media (min-width:1200px){
  .admin-main{max-width:860px;}
}

/* ---------- Page-title hierarchy ---------- */
.eyebrow{font-size:10.5px; letter-spacing:1.1px; color:var(--gold-dark); font-weight:700; text-transform:uppercase; margin-bottom:3px;}
body.dark .eyebrow{color:var(--gold);}
.admin-topbar{align-items:flex-start;}
.admin-topbar h2{line-height:1.2;}

/* ---------- Stat tiles with icon chip (admin dashboard) ---------- */
.stat-box{position:relative;}
.stat-box .icon{
  width:34px; height:34px; border-radius:9px; background:rgba(6,78,59,0.08);
  display:flex; align-items:center; justify-content:center; font-size:16px; margin-bottom:8px;
}
body.dark .stat-box .icon{background:rgba(198,155,60,0.12);}

/* ---------- Class/list rows with leading initial badge ---------- */
.class-row{position:relative; padding-left:0;}
.row-avatar{
  width:34px; height:34px; border-radius:9px; background:var(--deep-green); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;
  flex-shrink:0;
}

/* ---------- Overlapping stat strip (Naqeeb header) ---------- */
.stat-strip{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  margin:-26px 16px 20px; padding:14px 6px; display:flex; position:relative; z-index:2; box-shadow:var(--shadow);
}
.stat-strip .stat{flex:1; text-align:center; border-right:1px solid var(--line);}
.stat-strip .stat:last-child{border-right:none;}
.stat-strip .stat .num{font-size:19px; font-weight:800; color:var(--deep-green);}
body.dark .stat-strip .stat .num{color:var(--gold);}
.stat-strip .stat .lbl{font-size:10.5px; color:var(--muted); margin-top:3px; font-weight:600;}

/* ---------- Google sign-in button ---------- */
.btn.google-btn{background:#fff; color:#3c4043; border:1.5px solid #dadce0; font-size:14px; padding:14px; gap:10px;}
.btn.google-btn .btn-label{display:inline-flex; align-items:center; gap:10px;}
