/* Shibumi Academy — dashboard (same structure as Shibumi Life, in the Academy greens) */
:root { --washi:#F6F8EE; --paper:#fffef9; --sumi:#24301F; --ink-2:#4F5A46; --ink-3:#6D7764; --shu:#4E7D3A; --matcha:#9DBF7C; --matcha-deep:#3D5A33; --matcha-pale:#E6F0C3; --sakura:#FCE8EE; --line:#DFE6CF; --red:#B4473A; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.6 'Mulish', system-ui, sans-serif; background: var(--washi); color: var(--sumi); }
a { color: inherit; }
h1, h2, h3 { font-family: 'Cormorant Garamond', 'Shippori Mincho', Georgia, serif; font-weight: 600; margin: 0 0 .6em; line-height: 1.25; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--sumi); color: #d9d3ca; padding: 1.4rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: .6rem; padding: 0 1.3rem 1.4rem; text-decoration: none; color: #fff; font-family: 'Cormorant Garamond', 'Shippori Mincho', serif; font-size: 1.15rem; }
.seal { display: inline-grid; place-items: center; width: 28px; height: 28px; background: var(--shu); color: #fff; border-radius: 3px; font-family: 'Cormorant Garamond', 'Shippori Mincho', serif; }
.side nav a { display: flex; justify-content: space-between; padding: .45rem 1.3rem; text-decoration: none; font-size: .92rem; border-left: 2px solid transparent; }
.side nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side nav a.on { border-left-color: var(--shu); color: #fff; background: rgba(255,255,255,.06); }
.side .grp { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: #8a847b; padding: 1.1rem 1.3rem .35rem; }
.side .count { background: var(--shu); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .5em; }
.main { padding: 2rem clamp(1rem, 3vw, 2.8rem) 4rem; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.top h1 { margin: 0; }
.btn { display: inline-flex; align-items: center; gap: .4em; padding: .55em 1.1em; border: 1px solid var(--sumi); background: var(--sumi); color: #fff; border-radius: 4px; font: 500 .88rem/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--shu); border-color: var(--shu); }
.btn.ghost { background: transparent; color: var(--sumi); }
.btn.ghost:hover { background: var(--sumi); color: #fff; }
.btn.small { padding: .3em .7em; font-size: .8rem; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.green { background: var(--matcha-deep); border-color: var(--matcha-deep); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.3rem 1.4rem; margin-bottom: 1.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; text-decoration: none; }
.stat b { display: block; font-family: 'Cormorant Garamond', 'Shippori Mincho', serif; font-size: 1.9rem; font-weight: 600; }
.stat span { color: var(--ink-3); font-size: .85rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; background: #fbf8f2; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; }
td a:hover { color: var(--shu); }
.pill { display: inline-block; font-size: .72rem; padding: .15em .7em; border-radius: 99px; background: #eee9e1; color: var(--ink-2); white-space: nowrap; }
.pill.published, .pill.live, .pill.active, .pill.open, .pill.paid { background: var(--matcha-pale); color: var(--matcha-deep); }
.pill.soon, .pill.invoiced, .pill.requested { background: var(--sakura); color: #93261f; }
.pill.off, .pill.draft, .pill.expired, .pill.cancelled { background: #ece8e2; color: var(--ink-3); }
.flash { padding: .8rem 1rem; border-radius: 6px; margin-bottom: 1.2rem; background: var(--matcha-pale); border-left: 3px solid var(--matcha-deep); }
.flash.err { background: var(--sakura); border-color: var(--red); }
.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
form.inline { display: inline; }
label { display: block; font-weight: 500; font-size: .86rem; margin-bottom: .3rem; }
.help { font-size: .78rem; color: var(--ink-3); margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--sumi); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--matcha) 45%, transparent); border-color: var(--matcha-deep); }
textarea { min-height: 90px; resize: vertical; }
select[multiple] { min-height: 130px; }
.field { margin-bottom: 1.1rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.6rem; align-items: start; }
.form-grid aside { position: sticky; top: 1rem; }
@media (max-width: 1000px) { .form-grid { grid-template-columns: 1fr; } .form-grid aside { position: static; } }
.slug-wrap { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.slug-wrap span { padding: 0 .2rem 0 .7rem; color: var(--ink-3); font-size: .88rem; white-space: nowrap; }
.slug-wrap input { border: 0; padding-left: 0; }
.title-input { font-family: 'Cormorant Garamond', 'Shippori Mincho', serif !important; font-size: 1.5rem !important; padding: .6rem .8rem !important; }
.editor { background: #fff; border-radius: 0 0 4px 4px; }
.ql-toolbar.ql-snow { border-color: var(--line); border-radius: 4px 4px 0 0; background: #fbf8f2; position: sticky; top: 0; z-index: 3; }
.ql-container.ql-snow { border-color: var(--line); border-radius: 0 0 4px 4px; font: 17px/1.8 'Zen Kaku Gothic New', sans-serif; }
.ql-editor { min-height: 380px; padding: 1.2rem 1.4rem; }
.ql-editor h2, .ql-editor h3 { font-family: 'Cormorant Garamond', 'Shippori Mincho', serif; }
.img-field .preview { aspect-ratio: 4 / 3; background: #f0ebe3 center/cover no-repeat; border-radius: 4px; margin-bottom: .5rem; display: grid; place-items: center; color: var(--ink-3); font-size: .85rem; border: 1px dashed var(--line); }
.img-field .row { display: flex; gap: .4rem; flex-wrap: wrap; }
dialog { border: 0; border-radius: 8px; padding: 1.3rem; width: min(900px, 94vw); max-height: 86vh; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(31,29,27,.5); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; }
.mgrid button { border: 2px solid transparent; padding: 0; background: #f0ebe3; border-radius: 4px; cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.mgrid button:hover, .mgrid button:focus { border-color: var(--shu); }
.mgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.media-item { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.media-item form { padding: .7rem; }
.media-item .warn { color: var(--shu); font-size: .75rem; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.switch button { border: 0; background: #fff; padding: .4rem .8rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.switch button:last-child { border-right: 0; }
.switch button.on.off { background: #ece8e2; color: var(--sumi); font-weight: 600; }
.switch button.on.soon { background: var(--sakura); color: #93261f; font-weight: 600; }
.switch button.on.live { background: var(--matcha-deep); color: #fff; font-weight: 600; }
.links-grid { display: grid; grid-template-columns: 130px 1fr; gap: .4rem .6rem; align-items: center; }
.links-grid span { font-size: .85rem; color: var(--ink-2); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login .card { width: min(400px, 100%); padding: 2rem; }
.login h1 { display: flex; align-items: center; gap: .6rem; font-size: 1.4rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search] { max-width: 280px; }
.qr { width: 220px; height: 220px; background: #fff; padding: 10px; border: 1px solid var(--line); }
.qr img, .qr svg { width: 100%; height: 100%; }
pre.copy { background: #fff; border: 1px solid var(--line); padding: 1rem; white-space: pre-wrap; font: 13px/1.6 ui-monospace, monospace; border-radius: 4px; }
@media (max-width: 800px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .side nav { display: flex; flex-wrap: wrap; } .side .grp { display: none; } }
.ql-editor p { margin: 0 0 1em; } .ql-editor ul, .ql-editor ol { margin-bottom: 1em; }
.repeater { border: 1px solid var(--line); border-radius: 6px; padding: .8rem; background: #fbf8f2; }
.rep-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; align-items: end; padding: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 4px; margin-bottom: .6rem; }
.rep-row [data-remove] { justify-self: start; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: rgba(179,50,44,.04); }
.field[hidden] { display: none; } .rep-actions { display: flex; gap: .3rem; align-items: flex-start; }
.field.when-off { display: none; }
.rep-row:has(.rep-textarea) { grid-template-columns: 200px 1fr; align-items: start; }
.rep-row .rep-textarea textarea { width: 100%; min-height: 7rem; }
.rep-row:has(.rep-textarea) .rep-actions { grid-column: 1 / -1; }
.rep-row .rep-image .preview { max-height: 160px; }
.seal-img { width: 30px; height: 30px; display: inline-block; vertical-align: middle; margin-right: .4rem; }
.pubstate { font-size: .85rem; padding: .55rem .7rem; border-radius: 4px; margin-bottom: .8rem; border-left: 3px solid; }
.pubstate-draft { background: #f3efe7; border-color: #a39b8f; color: #5e574e; }
.pubstate-live { background: #eef3ea; border-color: #6f8f5e; color: #3f5a33; }
.pubstate-sched { background: #fbf1e6; border-color: #c08a3e; color: #7a5420; }

/* ---- Academy additions ---- */
h1 { font-size: 2.1rem; } h2 { font-size: 1.45rem; }
.side .brand .seal-img { border-radius: 50%; }
.side .count.warn { background: #E6C84A; color: #3e2f05; }
.tree { list-style: none; padding: 0; margin: 0; }
.tree .lvl { border-top: 1px solid var(--line); padding: .7rem 0; }
.tree .lvl-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tree .lvl-head strong { font-size: 1rem; }
.tree .lessons { list-style: none; margin: .4rem 0 0 1.4rem; padding: 0; }
.tree .lessons li { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; font-size: .92rem; }
.tree .lessons li a { text-decoration: none; }
.tree .lessons li a:hover { color: var(--shu); }
.tag { display: inline-block; font-size: .72rem; padding: .05em .6em; border-radius: 99px; background: var(--matcha-pale); color: var(--matcha-deep); font-weight: 600; }
.tag.draft, .tag.off { background: #eee; color: #777; } .tag.soon { background: #FFF2A6; color: #6B5810; } .tag.live { background: #C7DDAA; color: #2E4626; }
.tag.waiting { background: #FFF2A6; color: #6B5810; } .tag.paid, .tag.active { background: #C7DDAA; color: #2E4626; } .tag.cancelled, .tag.ended, .tag.paused { background: #eee; color: #666; }
.statebar { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.statebar button { border: 0; background: #fff; padding: .3rem .8rem; font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink-3); }
.statebar button.on { background: var(--shu); color: #fff; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: .35rem 1rem; font-size: .92rem; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.inline-form { display: inline; }
.banner { position: relative; border-radius: 14px; overflow: hidden; min-height: 150px; display: flex; align-items: flex-end; margin-bottom: 1.4rem; background: center/cover no-repeat; }
.banner .glass { background: rgba(255,254,249,.88); border-radius: 12px; padding: 1rem 1.3rem; margin: 1rem; backdrop-filter: blur(8px); }
.banner h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stats .stat { margin: 0; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
h1, h2, h3, .stat b { font-variant-numeric: lining-nums; }

/* ---- v2: lesson materials, quiz, uploads ---- */
.lesson-tools .xcard { padding: .4rem 0 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.lesson-tools .xcard:last-of-type { border-bottom: 0; }
.lesson-tools .xcard label { margin: .6rem 0 .2rem; }
.lesson-tools .xcard label input, .lesson-tools .xcard label textarea, .lesson-tools .xcard label select { margin-top: .3rem; font-weight: 400; }
.xfiles { margin-bottom: .6rem; } .xfiles td { vertical-align: top; }
.xext { display: inline-block; font-size: .7rem; font-weight: 800; background: var(--matcha-pale); color: var(--matcha-deep); border-radius: 4px; padding: .15rem .45rem; }
.uploader { border: 2px dashed var(--matcha); border-radius: 8px; padding: 1rem; text-align: center; background: #fff; }
.uploader.drag { background: var(--matcha-pale); }
.uploader .bar { height: 8px; border-radius: 99px; background: var(--matcha-pale); overflow: hidden; margin-top: .7rem; display: none; }
.uploader .bar i { display: block; height: 100%; width: 0; background: var(--matcha-deep); transition: width .2s; }
.qrow { border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem; margin-bottom: .7rem; background: #fff; }
