/* ===========================================================
   DotOne Consult LMS - theme
   Palette grounded in the DotOne mark: orange, ink-black, green.
   Display face: Zilla Slab (echoes the slab wordmark).
   Body face: Inter.  Data face: IBM Plex Mono.
   =========================================================== */

:root{
  --orange:#E97817;  --orange-600:#CC6510;  --orange-50:#FCEEDF;
  --ink:#1B1B1B;      --ink-700:#2C2C2C;
  --green:#27974E;    --green-50:#E6F3EC;
  --bg:#F5F4F0;       --surface:#FFFFFF;     --surface-2:#FBFAF7;
  --line:#E7E3DB;     --muted:#6E6A62;       --text:#23211D;
  --radius:14px;      --radius-sm:10px;
  --shadow:0 1px 2px rgba(27,27,27,.04), 0 8px 24px rgba(27,27,27,.06);
  --shadow-sm:0 1px 2px rgba(27,27,27,.06);
  --sidebar:264px;
  --ok:#27974E; --warn:#C9831A; --bad:#C8412B; --info:#2563A8;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
  background:var(--bg); color:var(--text);
  font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,.display{font-family:"Zilla Slab","Inter",serif; color:var(--ink); margin:0 0 .35em; line-height:1.15; letter-spacing:-.01em}
h1{font-size:1.85rem; font-weight:700}
h2{font-size:1.35rem; font-weight:700}
h3{font-size:1.08rem; font-weight:600}
a{color:var(--orange-600); text-decoration:none}
a:hover{text-decoration:underline}
small,.text-muted{color:var(--muted)}
code,.mono{font-family:"IBM Plex Mono",ui-monospace,monospace}

/* ---------- App shell ---------- */
.app{display:flex; min-height:100vh}
.sidebar{
  width:var(--sidebar); background:var(--ink); color:#D9D6CF;
  position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column;
  z-index:40; transition:transform .25s ease;
}
.sidebar .brand{display:flex; align-items:center; gap:.6rem; padding:1.05rem 1.1rem; border-bottom:1px solid rgba(255,255,255,.08)}
.sidebar .brand .mark{flex:0 0 36px}
.sidebar .brand b{font-family:"Zilla Slab",serif; color:#fff; font-size:1.12rem; letter-spacing:-.01em; line-height:1}
.sidebar .brand span{display:block; font-size:.64rem; color:var(--orange); letter-spacing:.04em; margin-top:2px}
.nav{padding:.7rem .6rem; overflow-y:auto; flex:1}
.nav .group{font-size:.66rem; text-transform:uppercase; letter-spacing:.12em; color:#7C786F; margin:1rem .7rem .4rem}
.nav a{
  display:flex; align-items:center; gap:.7rem; padding:.6rem .8rem; border-radius:var(--radius-sm);
  color:#C9C5BD; font-weight:500; font-size:.92rem; margin-bottom:2px;
}
.nav a:hover{background:rgba(255,255,255,.06); color:#fff; text-decoration:none}
.nav a.active{background:var(--orange); color:#fff}
.nav a.active svg{stroke:#fff}
.nav svg{width:18px;height:18px;stroke:#8E8A81;stroke-width:1.9;fill:none;flex:0 0 18px}
.nav a:hover svg{stroke:#fff}
.sidebar .foot{padding:.8rem 1rem; border-top:1px solid rgba(255,255,255,.08); font-size:.72rem; color:#7C786F}

.main{flex:1; margin-left:var(--sidebar); display:flex; flex-direction:column; min-width:0}
.topbar{
  position:sticky; top:0; z-index:30; background:rgba(255,255,255,.85); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line); padding:.7rem 1.4rem;
  display:flex; align-items:center; gap:1rem;
}
.topbar .page-title{font-family:"Zilla Slab",serif; font-weight:600; font-size:1.15rem; color:var(--ink)}
.topbar .spacer{flex:1}
.hamburger{display:none; background:none; border:0; cursor:pointer; padding:6px}
.hamburger svg{width:24px;height:24px;stroke:var(--ink);stroke-width:2;fill:none}
.content{padding:1.5rem 1.4rem 3rem; max-width:1180px; width:100%}

/* user chip */
.userchip{display:flex; align-items:center; gap:.6rem}
.avatar{width:36px;height:36px;border-radius:50%; background:var(--orange); color:#fff;
  display:grid; place-items:center; font-weight:700; font-size:.82rem; overflow:hidden; flex:0 0 36px}
.avatar img{width:100%;height:100%;object-fit:cover}
.userchip .who{line-height:1.1}
.userchip .who b{font-size:.86rem; color:var(--ink)}
.userchip .who small{display:block; font-size:.7rem}

/* ---------- Cards / grid ---------- */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm)}
.card .card-h{padding:1rem 1.2rem; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:.6rem}
.card .card-h h3{margin:0}
.card .card-b{padding:1.2rem}
.grid{display:grid; gap:1.1rem}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}

/* stat tiles */
.stat{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:1.1rem 1.2rem; position:relative; overflow:hidden}
.stat .label{font-size:.74rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:600}
.stat .value{font-family:"Zilla Slab",serif; font-size:2rem; font-weight:700; color:var(--ink); line-height:1.1; margin-top:.2rem}
.stat .ic{position:absolute; top:1rem; right:1rem; width:34px;height:34px;border-radius:10px; display:grid; place-items:center; background:var(--orange-50)}
.stat .ic svg{width:18px;height:18px;stroke:var(--orange-600);stroke-width:2;fill:none}
.stat.green .ic{background:var(--green-50)} .stat.green .ic svg{stroke:var(--green)}

/* ---------- Buttons ---------- */
.btn{display:inline-flex; align-items:center; gap:.45rem; border:1px solid transparent; border-radius:var(--radius-sm);
  padding:.55rem .95rem; font:inherit; font-weight:600; font-size:.9rem; cursor:pointer; transition:.15s; white-space:nowrap}
.btn:hover{text-decoration:none}
.btn svg{width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none}
.btn-primary{background:var(--orange); color:#fff}
.btn-primary:hover{background:var(--orange-600); color:#fff}
.btn-dark{background:var(--ink); color:#fff} .btn-dark:hover{background:#000}
.btn-ghost{background:var(--surface); color:var(--ink); border-color:var(--line)}
.btn-ghost:hover{background:var(--surface-2)}
.btn-danger{background:#fff; color:var(--bad); border-color:#EAD3CD}
.btn-danger:hover{background:var(--bad); color:#fff}
.btn-sm{padding:.35rem .65rem; font-size:.82rem}
.btn-block{display:flex; width:100%; justify-content:center}
.btn[disabled]{opacity:.55; cursor:not-allowed}

/* ---------- Forms ---------- */
.field{margin-bottom:1rem}
.field label{display:block; font-weight:600; font-size:.84rem; color:var(--ink-700); margin-bottom:.35rem}
.field .hint{font-size:.76rem; color:var(--muted); margin-top:.3rem}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=date],
input[type=datetime-local],input[type=tel],input[type=search],select,textarea{
  width:100%; padding:.6rem .75rem; border:1px solid var(--line); border-radius:var(--radius-sm);
  font:inherit; background:#fff; color:var(--text); transition:.15s;
}
input:focus,select:focus,textarea:focus{outline:none; border-color:var(--orange); box-shadow:0 0 0 3px var(--orange-50)}
textarea{min-height:110px; resize:vertical}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:1rem}
.row3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:1rem}
.check{display:flex; align-items:center; gap:.5rem; font-size:.9rem}
.check input{width:auto}

/* ---------- Tables ---------- */
.table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface)}
table.tbl{width:100%; border-collapse:collapse; font-size:.9rem; min-width:640px}
.tbl th{text-align:left; padding:.7rem .9rem; background:var(--surface-2); border-bottom:1px solid var(--line);
  font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700}
.tbl td{padding:.7rem .9rem; border-bottom:1px solid var(--line); vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl tr:hover td{background:var(--surface-2)}
.tbl .nowrap{white-space:nowrap}

/* ---------- Badges & alerts ---------- */
.badge{display:inline-block; padding:.18rem .55rem; border-radius:999px; font-size:.72rem; font-weight:700; letter-spacing:.02em}
.badge-ok{background:var(--green-50); color:var(--green)}
.badge-bad{background:#FBE9E5; color:var(--bad)}
.badge-warn{background:#FBF0DD; color:var(--warn)}
.badge-info{background:#E5EEF8; color:var(--info)}
.badge-muted{background:#EFEDE8; color:var(--muted)}
.alert{padding:.8rem 1rem; border-radius:var(--radius-sm); margin-bottom:1rem; font-size:.9rem; display:flex; gap:.6rem; align-items:flex-start; border:1px solid}
.alert b{font-weight:700}
.alert-success{background:var(--green-50); border-color:#BFE2CC; color:#1C6B39}
.alert-error{background:#FBE9E5; border-color:#F0CABF; color:#9B3322}
.alert-info{background:#E5EEF8; border-color:#C5DAF0; color:#1E4E82}
.alert-warn{background:#FBF0DD; border-color:#EBD6AC; color:#8A5A11}

/* ---------- Page header ---------- */
.page-head{display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1.3rem; flex-wrap:wrap}
.page-head .sub{color:var(--muted); font-size:.9rem; margin-top:.1rem}
.toolbar{display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; margin-bottom:1.1rem}
.toolbar .grow{flex:1; min-width:160px}

/* ---------- Empty / misc ---------- */
.empty{text-align:center; padding:3rem 1rem; color:var(--muted)}
.empty svg{width:46px;height:46px;stroke:var(--line);stroke-width:1.6;fill:none;margin-bottom:.6rem}
.divider{height:1px; background:var(--line); margin:1.2rem 0}
.pill-tabs{display:flex; gap:.4rem; background:var(--surface-2); padding:.3rem; border-radius:var(--radius-sm); border:1px solid var(--line); flex-wrap:wrap}
.pill-tabs a{padding:.45rem .9rem; border-radius:8px; font-size:.86rem; font-weight:600; color:var(--muted)}
.pill-tabs a.active{background:#fff; color:var(--ink); box-shadow:var(--shadow-sm)}
.progress{height:8px; background:var(--line); border-radius:999px; overflow:hidden}
.progress > span{display:block; height:100%; background:var(--green); border-radius:999px}
kbd{background:var(--ink); color:#fff; border-radius:6px; padding:1px 6px; font-size:.78rem}

/* course / material cards */
.course-card{display:flex; flex-direction:column; overflow:hidden}
.course-card .cover{height:96px; background:linear-gradient(120deg,var(--ink),var(--orange-600)); position:relative}
.course-card .cover .code{position:absolute; bottom:.6rem; left:.9rem; color:#fff; font-family:"IBM Plex Mono",monospace; font-size:.74rem; opacity:.9}
.course-card .body{padding:1rem 1.1rem; flex:1; display:flex; flex-direction:column}
.course-card h3{margin-bottom:.3rem}
.course-card .meta{font-size:.78rem; color:var(--muted); margin-top:auto; padding-top:.7rem; display:flex; gap:1rem}

.mat-item{display:flex; gap:.85rem; padding:.85rem 1rem; border:1px solid var(--line); border-radius:var(--radius-sm); background:#fff; margin-bottom:.6rem; align-items:center}
.mat-item .ic{width:38px;height:38px;border-radius:10px; display:grid; place-items:center; flex:0 0 38px; background:var(--orange-50)}
.mat-item .ic svg{width:18px;height:18px;stroke:var(--orange-600);stroke-width:2;fill:none}
.mat-item .ic.video{background:#FBE9E5} .mat-item .ic.video svg{stroke:var(--bad)}
.mat-item .ic.note{background:var(--green-50)} .mat-item .ic.note svg{stroke:var(--green)}
.mat-item .grow{flex:1; min-width:0}
.mat-item .grow b{display:block; color:var(--ink)}

/* ---------- Quiz / exam ---------- */
.exam-bar{position:sticky; top:0; z-index:20; background:var(--ink); color:#fff; padding:.7rem 1.2rem;
  display:flex; align-items:center; justify-content:space-between; border-radius:var(--radius) var(--radius) 0 0}
.timer{font-family:"IBM Plex Mono",monospace; font-size:1.15rem; font-weight:700; background:rgba(255,255,255,.12); padding:.25rem .7rem; border-radius:8px}
.timer.danger{background:var(--bad); animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.55}}
.qcard{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:1.3rem; margin-bottom:1rem}
.qcard .qno{font-family:"Zilla Slab",serif; font-weight:700; color:var(--orange-600)}
.opt{display:flex; gap:.7rem; align-items:flex-start; padding:.7rem .9rem; border:1px solid var(--line); border-radius:var(--radius-sm); margin-bottom:.55rem; cursor:pointer; transition:.12s}
.opt:hover{border-color:var(--orange); background:var(--orange-50)}
.opt input{margin-top:3px}
.opt.correct{border-color:var(--green); background:var(--green-50)}
.opt.wrong{border-color:var(--bad); background:#FBE9E5}

/* ---------- Auth pages ---------- */
.auth{min-height:100vh; display:grid; grid-template-columns:1.05fr .95fr}
.auth .hero{background:var(--ink); color:#fff; padding:3rem; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden}
.auth .hero .glow{position:absolute; width:520px;height:520px; border-radius:50%;
  background:radial-gradient(circle,var(--orange) 0%,transparent 62%); opacity:.5; top:-120px; right:-160px; filter:blur(8px)}
.auth .hero h1{color:#fff; font-size:2.4rem; max-width:12ch}
.auth .hero .tag{color:var(--green); font-style:italic; font-size:1rem; margin-top:.4rem}
.auth .hero .pts{margin-top:2rem; display:grid; gap:.8rem}
.auth .hero .pts div{display:flex; gap:.7rem; align-items:center; color:#D9D6CF; font-size:.95rem}
.auth .hero .pts svg{width:20px;height:20px;stroke:var(--orange);stroke-width:2;fill:none;flex:0 0 20px}
.auth .panel{display:grid; place-items:center; padding:2.5rem}
.auth .panel .box{width:100%; max-width:380px}
.auth .panel .box h2{font-size:1.6rem}

/* notice / paywall */
.notice{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:2rem; text-align:center}
.notice .ic{width:60px;height:60px;border-radius:16px;margin:0 auto 1rem; display:grid; place-items:center; background:#FBE9E5}
.notice .ic svg{width:30px;height:30px;stroke:var(--bad);stroke-width:1.8;fill:none}

/* ---------- Responsive ---------- */
.backdrop{display:none}
@media (max-width:1024px){ .grid.cols-4{grid-template-columns:repeat(2,1fr)} .grid.cols-3{grid-template-columns:repeat(2,1fr)} }
@media (max-width:860px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0}
  .hamburger{display:block}
  .backdrop.show{display:block; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:35}
  .auth{grid-template-columns:1fr} .auth .hero{display:none}
  .row2,.row3{grid-template-columns:1fr}
  .grid.cols-2,.grid.cols-3,.grid.cols-4{grid-template-columns:1fr}
  .content{padding:1.1rem .9rem 3rem}
}
@media print{.sidebar,.topbar,.toolbar,.btn{display:none!important} .main{margin:0}}
