/* ============================================================
   SayaLay IELTS Practice — app shell design system
   Sidebar layout · rich rows · status pills · progress bars
   Load AFTER each page's own <style> so it wins the cascade.
   ============================================================ */

:root{
  --ap-paper:#f6f4ee;
  --ap-ink:#1b2a3a;
  --ap-sidebar:#1b2a3a;
  --ap-muted:#6a7584;
  --ap-faint:#9aa3b0;
  --ap-line:#e9e3d6;
  --ap-brass:#a9792b;
  --ap-brass-soft:#efe4c8;
  --ap-teal:#2e6b5e;
  --ap-teal-bg:#e4f1ec;
  --ap-rose:#bf4a3c;
  --ap-amber:#8a5a12;
  --ap-amber-bg:#faedd2;
  --ap-green:#3f6b3a;
  --ap-green-bg:#e9f0e3;
  --ap-cream:#efe9db;
  --ap-white:#fff;
  --ap-nav-muted:#8b97a6;
  --ap-ease:cubic-bezier(.22,1,.36,1);
  --ap-shadow:0 1px 2px rgba(27,42,58,.04),0 10px 30px -24px rgba(27,42,58,.35);
  --ap-shadow-lift:0 14px 34px -22px rgba(27,42,58,.4);
}

/* reset the old top-nav chrome when the shell is active */
body.ap .header{display:none !important;}

body.ap{
  margin:0;background:var(--ap-paper) !important;background-image:none !important;
  font-family:'Instrument Sans',system-ui,sans-serif;color:var(--ap-ink);
}
body.ap a{text-decoration:none;color:inherit;}

.ap-shell{display:flex;min-height:100vh;}

/* ---------------- SIDEBAR ---------------- */
.ap-side{
  width:250px;flex-shrink:0;background:var(--ap-sidebar);color:#fff;
  display:flex;flex-direction:column;padding:22px 16px;position:sticky;top:0;height:100vh;
}
.ap-brand{display:flex;align-items:center;gap:11px;padding:4px 8px 18px;}
.ap-brand img{height:30px;width:auto;}
.ap-brand .bw{font-family:'Fraunces',serif;font-weight:600;font-size:18px;color:#fff;}
.ap-nav{display:flex;flex-direction:column;gap:4px;}
.ap-nav a{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:9px;
  font-size:14.5px;font-weight:500;color:var(--ap-nav-muted);
  transition:background .16s,color .16s;
}
.ap-nav a .ic{width:8px;height:8px;border-radius:50%;background:currentColor;opacity:.5;flex-shrink:0;}
.ap-nav a:hover{color:#fff;background:rgba(255,255,255,.05);}
.ap-nav a.active{background:rgba(255,255,255,.09);color:#fff;font-weight:600;}
.ap-nav a.active .ic{background:var(--ap-brass);opacity:1;}
.ap-side .grow{flex:1;}
.ap-side .ap-foot{border-top:1px solid rgba(255,255,255,.08);padding-top:14px;margin-top:6px;}

/* ---------------- MAIN ---------------- */
.ap-main{flex:1;min-width:0;padding:30px 40px 60px;max-width:1240px;}
.ap-top{display:flex;justify-content:space-between;align-items:flex-end;gap:30px;margin-bottom:28px;}
.ap-top h1{font-family:'Fraunces',serif;font-weight:500;font-size:30px;letter-spacing:-.01em;line-height:1.1;margin:0;}
.ap-top .sub{color:var(--ap-muted);font-size:15px;margin-top:5px;}
.ap-acct{text-align:right;flex-shrink:0;}
.ap-acct .line1{display:flex;align-items:center;gap:8px;justify-content:flex-end;}
.ap-acct .nm{font-weight:600;font-size:14px;}
.ap-acct .line2{color:var(--ap-muted);font-size:12.5px;margin-top:4px;}

/* section header */
.ap-sec{display:flex;justify-content:space-between;align-items:center;
  border-bottom:1px solid var(--ap-line);padding-bottom:12px;margin-bottom:18px;}
.ap-sec h2{font-family:'Fraunces',serif;font-weight:600;font-size:20px;margin:0;}
.ap-sec .meta{color:var(--ap-muted);font-size:13px;}

/* ---------------- PILLS ---------------- */
.ap-pill{display:inline-flex;align-items:center;font-size:11px;font-weight:600;
  padding:3px 10px;border-radius:100px;letter-spacing:.01em;}
.ap-pill.new{background:var(--ap-teal-bg);color:var(--ap-teal);}
.ap-pill.progress{background:var(--ap-amber-bg);color:var(--ap-amber);}
.ap-pill.done{background:var(--ap-green-bg);color:var(--ap-green);}
.ap-pill.paid{background:var(--ap-green);color:#fff;}
.ap-pill.free{background:var(--ap-cream);color:var(--ap-muted);}

/* ---------------- RICH ROW ---------------- */
.ap-rows{display:flex;flex-direction:column;gap:14px;}
.ap-row{
  background:var(--ap-white);border:1px solid var(--ap-line);border-radius:14px;
  padding:18px 20px;display:flex;align-items:center;gap:20px;
  box-shadow:var(--ap-shadow);transition:transform .18s var(--ap-ease),box-shadow .2s,border-color .18s;
  animation:apRise .4s var(--ap-ease) both;
}
.ap-row:hover{transform:translateY(-2px);box-shadow:var(--ap-shadow-lift);border-color:#dcd4c2;}
.ap-badge{width:58px;height:58px;border-radius:12px;background:var(--ap-cream);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  font-family:'Fraunces',serif;font-weight:600;font-size:22px;color:var(--ap-brass);}
.ap-mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:11px;}
.ap-title-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.ap-title-row .tt{font-family:'Fraunces',serif;font-weight:500;font-size:19px;}
.ap-cols{display:flex;gap:30px;flex-wrap:wrap;}
.ap-col{display:flex;flex-direction:column;gap:2px;}
.ap-col .cl{font-size:12px;color:var(--ap-muted);}
.ap-col .cv{font-family:'Fraunces',serif;font-weight:500;font-size:15px;color:var(--ap-ink);}
.ap-col .cv.band{font-weight:600;color:var(--ap-teal);}
.ap-col .cv.none{color:var(--ap-muted);font-weight:400;}
.ap-col a.cv{color:var(--ap-ink);border-bottom:1.5px solid var(--ap-brass-soft);padding-bottom:1px;width:max-content;transition:border-color .15s;}
.ap-col a.cv:hover{border-color:var(--ap-brass);}
.ap-col a.cv.lock{color:var(--ap-muted);border:none;}
.ap-prog{display:flex;flex-direction:column;gap:6px;}
.ap-bar{width:260px;max-width:40vw;height:6px;background:var(--ap-line);border-radius:100px;overflow:hidden;}
.ap-bar>i{display:block;height:100%;border-radius:100px;background:var(--ap-brass);}
.ap-bar>i.full{background:var(--ap-green);}
.ap-prog .pl{font-size:12px;color:var(--ap-muted);}
.ap-acts{display:flex;gap:10px;align-items:center;flex-shrink:0;}

/* ---------------- BUTTONS ---------------- */
.ap-btn{font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;border-radius:9px;
  padding:11px 20px;transition:transform .14s var(--ap-ease),box-shadow .18s,background .14s,border-color .14s;display:inline-flex;align-items:center;gap:7px;}
.ap-btn.ink{background:var(--ap-ink);color:#fff;border:1px solid var(--ap-ink);box-shadow:0 3px 10px rgba(27,42,58,.18);}
.ap-btn.ink:hover{background:#13202e;transform:translateY(-2px);box-shadow:0 7px 18px rgba(27,42,58,.26);}
.ap-btn.quiet{background:var(--ap-white);color:var(--ap-ink);border:1px solid var(--ap-line);}
.ap-btn.quiet:hover{border-color:var(--ap-ink);transform:translateY(-2px);box-shadow:0 5px 14px rgba(27,42,58,.1);}
.ap-btn.red{background:var(--ap-rose);color:#fff;border:1px solid #a53b2d;box-shadow:0 3px 12px rgba(191,74,60,.26);}
.ap-btn.red:hover{transform:translateY(-2px);box-shadow:0 7px 18px rgba(191,74,60,.34);}
.ap-btn:active{transform:translateY(0) scale(.97);}
.ap-btn.lock{background:var(--ap-cream);color:var(--ap-muted);border:1px solid var(--ap-line);box-shadow:none;cursor:pointer;}

/* ---------------- PLAIN CARD / TABLE (history, account) ---------------- */
.ap-card{background:var(--ap-white);border:1px solid var(--ap-line);border-radius:14px;box-shadow:var(--ap-shadow);}
.ap-stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-bottom:26px;}
.ap-stat{background:var(--ap-white);border:1px solid var(--ap-line);border-radius:12px;padding:16px 18px;box-shadow:var(--ap-shadow);}
.ap-stat .l{font-size:12px;color:var(--ap-muted);margin-bottom:6px;}
.ap-stat .v{font-family:'Fraunces',serif;font-size:24px;font-weight:500;line-height:1;}
.ap-stat .v em{font-style:normal;color:var(--ap-teal);}

@keyframes apRise{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}
.ap-rows .ap-row:nth-child(2){animation-delay:.05s;}
.ap-rows .ap-row:nth-child(3){animation-delay:.1s;}
.ap-rows .ap-row:nth-child(4){animation-delay:.15s;}
.ap-rows .ap-row:nth-child(5){animation-delay:.2s;}
.ap-rows .ap-row:nth-child(6){animation-delay:.25s;}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width:860px){
  .ap-shell{flex-direction:column;}
  .ap-side{width:auto;height:auto;position:static;flex-direction:row;align-items:center;
    gap:8px;overflow-x:auto;padding:12px 14px;}
  .ap-side .ap-brand{padding:0 10px 0 4px;border:none;}
  .ap-side .ap-nav{flex-direction:row;gap:4px;}
  .ap-side .grow,.ap-side .ap-foot{display:none;}
  .ap-main{padding:22px 18px 50px;}
  .ap-top{flex-direction:column;align-items:flex-start;gap:12px;}
  .ap-acct{text-align:left;}
  .ap-acct .line1{justify-content:flex-start;}
  .ap-row{flex-wrap:wrap;}
  .ap-acts{width:100%;}
}
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms !important;transition-duration:.08s !important;}
}
