:root {
  --black:#111;
  --white:#fff;
  --bg:#f3f4f6;
  --card:#fff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --accent:#d9f99d;
  --accent-strong:#84cc16;
  --green:#dcfce7;
  --blue:#dbeafe;
  --yellow:#fef3c7;
  --red:#fee2e2;
  --shadow:0 14px 38px rgba(17,24,39,.08);
  --safe-top:max(12px,var(--tg-content-safe-area-inset-top,0px));
  --safe-bottom:max(10px,var(--tg-content-safe-area-inset-bottom,0px));
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
.splash{min-height:100vh;display:grid;place-content:center;justify-items:center;gap:10px;background:var(--black);color:#fff}
.splash .logo,.brand-logo{width:64px;height:64px;border-radius:21px;display:grid;place-items:center;background:var(--accent);color:var(--black);font-size:32px;font-weight:950;transform:rotate(-5deg)}
.splash strong{font-size:28px;letter-spacing:.08em}
.splash span{color:#a1a1aa;font-size:13px}
.shell{min-height:100vh;padding-bottom:calc(88px + var(--safe-bottom))}
.topbar{position:sticky;top:0;z-index:20;padding:var(--safe-top) 15px 11px;background:rgba(17,17,17,.97);color:#fff;display:flex;align-items:center;justify-content:space-between;backdrop-filter:blur(18px)}
.brand{display:flex;align-items:center;gap:10px}
.brand-logo{width:36px;height:36px;border-radius:12px;font-size:18px}
.brand-title{font-weight:950;letter-spacing:.04em}
.brand-sub{font-size:10px;color:#a1a1aa}
.user-pill{display:flex;align-items:center;gap:8px;background:#27272a;border-radius:14px;padding:6px 9px}
.user-avatar{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:var(--accent);color:#111;font-weight:900}
.user-name{font-size:11px;font-weight:800;max-width:105px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-role{font-size:9px;color:#a1a1aa}
.page{max-width:850px;margin:auto;padding:17px 13px}
.hero{position:relative;overflow:hidden;background:var(--black);color:#fff;border-radius:28px;padding:22px;box-shadow:var(--shadow)}
.hero:after{content:"";position:absolute;right:-45px;top:-45px;width:175px;height:175px;border-radius:50%;background:var(--accent)}
.hero>*{position:relative;z-index:1}
.eyebrow{text-transform:uppercase;letter-spacing:.1em;color:#a1a1aa;font-size:10px;font-weight:800}
.hero h1{font-size:28px;line-height:1.05;margin:7px 0;max-width:74%}
.hero p{margin:0;max-width:72%;color:#d4d4d8;font-size:12px;line-height:1.45}
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;margin-top:12px}
.stat,.card{background:var(--card);border:1px solid var(--line);border-radius:20px;box-shadow:0 8px 24px rgba(17,24,39,.04)}
.stat{padding:15px}.stat b{display:block;font-size:25px}.stat span{font-size:10px;color:var(--muted)}
.section{margin-top:20px}
.section-head{display:flex;justify-content:space-between;align-items:end;margin:0 2px 9px;gap:10px}
.section-title{font-size:18px;font-weight:900}
.section-sub{font-size:10px;color:var(--muted);margin-top:2px}
.link{border:0;background:transparent;color:#4d7c0f;font-weight:800;padding:5px}
.lesson-list,.list,.grid{display:grid;gap:9px}
.lesson{width:100%;display:grid;grid-template-columns:53px 1fr auto;align-items:center;gap:11px;border:1px solid var(--line);border-radius:20px;background:#fff;padding:13px;text-align:left;box-shadow:0 7px 20px rgba(17,24,39,.035)}
.timebox{min-height:53px;border-radius:15px;background:#111;color:#fff;display:grid;place-content:center;text-align:center;font-size:12px;font-weight:900}
.timebox small{display:block;color:#a1a1aa;font-size:8px}
.lesson-name,.person-name{font-size:14px;font-weight:900}
.lesson-meta,.person-meta{font-size:10px;color:var(--muted);margin-top:3px;line-height:1.35}
.chev{font-size:20px;color:#a1a1aa}
.status,.badge{display:inline-flex;margin-top:6px;padding:4px 7px;border-radius:8px;background:var(--blue);font-size:9px;font-weight:800}
.status.done{background:var(--green)}.status.warn{background:var(--yellow)}.status.danger{background:var(--red)}
.empty{padding:25px;text-align:center;color:var(--muted)}
.bottom-nav{position:fixed;z-index:30;left:9px;right:9px;bottom:calc(7px + var(--safe-bottom));max-width:820px;margin:auto;background:rgba(17,17,17,.97);border-radius:23px;padding:7px;display:grid;grid-template-columns:repeat(4,1fr);box-shadow:0 18px 45px rgba(17,24,39,.25);backdrop-filter:blur(18px)}
.nav{border:0;border-radius:16px;background:transparent;color:#a1a1aa;padding:8px 3px;display:grid;justify-items:center;gap:2px}
.nav.active{background:var(--accent);color:#111}.nav i{font-style:normal;font-size:18px}.nav span{font-size:8px;font-weight:850}
.calendar{padding:13px}
.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.month{font-size:17px;font-weight:950;text-transform:capitalize}
.icon-btn{width:37px;height:37px;border-radius:12px;border:1px solid var(--line);background:#fff;font-size:18px}
.week,.days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.week div{text-align:center;color:var(--muted);font-size:9px;font-weight:800;padding:4px}
.day{aspect-ratio:1;border:0;border-radius:12px;background:transparent;position:relative;font-size:12px;font-weight:800}
.day.out{color:#c7c9cf}.day.today{outline:2px solid #111;outline-offset:-2px}.day.selected{background:#111;color:#fff}
.day.has:after{content:"";position:absolute;bottom:4px;left:50%;width:5px;height:5px;margin-left:-2px;border-radius:50%;background:var(--accent-strong)}
.person{width:100%;display:flex;align-items:center;gap:11px;text-align:left;background:#fff;border:1px solid var(--line);border-radius:20px;padding:14px}
.avatar{flex:0 0 45px;height:45px;border-radius:15px;background:var(--accent);display:grid;place-items:center;font-weight:950}
.person-main{min-width:0;flex:1}.person-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.badges{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.badge{margin:0;background:var(--bg)}
.toolbar{display:flex;gap:7px;overflow:auto;padding-bottom:2px}.chip{white-space:nowrap;border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 11px;font-size:10px;font-weight:800}.chip.active{background:#111;color:#fff}
.btn{border:0;border-radius:14px;min-height:43px;padding:10px 13px;background:#111;color:#fff;font-weight:850}.btn.secondary{background:var(--bg);color:var(--text);border:1px solid var(--line)}.btn.accent{background:var(--accent);color:#111}.btn.danger{background:var(--red);color:#991b1b}.btn.full{width:100%}
.actions{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:10px}
.request{padding:14px}.request-top{display:flex;justify-content:space-between;gap:8px}.request-type{font-size:12px;font-weight:900}.request-date{font-size:9px;color:var(--muted)}.request-text{font-size:11px;line-height:1.45;margin-top:8px}.answer{background:var(--green);border-radius:11px;padding:9px;margin-top:8px;font-size:10px}
.modal-bg{position:fixed;inset:0;z-index:100;background:rgba(17,17,17,.55);backdrop-filter:blur(5px);display:flex;align-items:flex-end;padding:25px 9px calc(9px + var(--safe-bottom))}
.modal{width:100%;max-width:780px;max-height:91vh;overflow:auto;margin:auto;background:#fff;border-radius:27px;box-shadow:0 30px 90px rgba(0,0,0,.3)}
.handle{width:40px;height:4px;border-radius:99px;background:#d4d4d8;margin:9px auto}
.modal-head{padding:9px 17px 10px;display:flex;align-items:start;justify-content:space-between;gap:10px}.modal-title{font-size:19px;font-weight:950}.modal-sub{font-size:10px;color:var(--muted);margin-top:2px}.close{width:35px;height:35px;border:0;border-radius:11px;background:var(--bg);font-size:18px}
.modal-body{padding:3px 17px 19px}
.details{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.detail{padding:11px;border-radius:14px;background:var(--bg)}.detail label{font-size:8px;color:var(--muted);text-transform:uppercase}.detail b{display:block;font-size:12px;margin-top:3px}
.form{display:grid;gap:10px}.field{display:grid;gap:5px}.field label{font-size:10px;font-weight:850}.input,.select,.textarea{width:100%;border:1px solid var(--line);border-radius:13px;background:#fff;padding:11px 12px;outline:none}.textarea{min-height:90px;resize:vertical}.input:focus,.select:focus,.textarea:focus{border-color:#111;box-shadow:0 0 0 3px rgba(17,17,17,.07)}
.form-row{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.form-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:8px;margin-top:3px}
.toast{position:fixed;left:14px;right:14px;bottom:calc(91px + var(--safe-bottom));z-index:200;max-width:550px;margin:auto;background:#111;color:#fff;border-radius:14px;padding:12px 14px;font-size:11px;font-weight:800;box-shadow:var(--shadow)}.toast.error{background:#991b1b}
.error-screen{min-height:100vh;background:#111;color:#fff;display:grid;place-content:center;text-align:center;padding:28px}.error-screen p{color:#a1a1aa;max-width:340px;line-height:1.5}
@media(min-width:650px){.stats{grid-template-columns:repeat(4,1fr)}.page{padding:20px}.hero{padding:27px}.hero h1{font-size:34px}.grid.two{grid-template-columns:repeat(2,1fr)}}
.inline-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.check-row{display:flex;align-items:flex-start;gap:9px;font-size:11px;line-height:1.4;padding:9px 0}
.check-row input{margin-top:2px}
.warning-box{padding:11px 12px;border-radius:13px;background:var(--yellow);font-size:10px;line-height:1.45;color:#713f12}

/* Final production UI additions */
.quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.quick-grid .btn{margin:0}.scroll{overflow-x:auto;white-space:nowrap;scrollbar-width:none}.scroll::-webkit-scrollbar{display:none}.segment.scroll{display:flex;gap:6px;padding:5px;margin-bottom:14px}.manage-card{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.manage-card>div:first-child{min-width:0}.manage-card b,.manage-card span{display:block}.manage-card span{font-size:12px;color:var(--muted);margin-top:4px}.manage-card>div:last-child{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.mini{border:0;border-radius:10px;padding:8px 10px;background:#eceef1;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.mini.danger,.btn.danger{background:#fee2e2;color:#991b1b}.lesson-wrap{display:flex;align-items:center;gap:7px}.lesson-wrap .lesson{flex:1}.lesson-check{width:20px;height:20px;accent-color:#111}.slot-grid{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.slot{font-size:12px;font-weight:700;background:#ecfdf5;color:#065f46;border-radius:999px;padding:7px 9px}.report-box{border-radius:15px;background:#f8fafc;padding:13px;margin:12px 0}.report-box p{margin:8px 0;font-size:13px;line-height:1.45}.progress{height:8px;background:#e5e7eb;border-radius:999px;margin-top:10px;overflow:hidden}.progress span{display:block;height:100%;background:#111;border-radius:999px}.danger-zone{border-top:1px solid #eee;padding-top:14px;margin-top:12px}.check{display:flex;align-items:center;gap:9px;font-size:14px;padding:7px 0}.check input{width:18px;height:18px;accent-color:#111}.notice{background:#f3f4f6;border-radius:13px;padding:12px;font-size:13px;line-height:1.45;margin:8px 0}.action-list{display:grid;gap:9px;margin-top:14px}.compact{padding-bottom:20px}.card h3,.modal h3{margin:16px 0 8px}.list-line>div:first-child{min-width:0}.list-line span{overflow-wrap:anywhere}.btn[disabled]{opacity:.45;cursor:not-allowed}
@media(max-width:520px){.quick-grid{grid-template-columns:1fr}.manage-card{align-items:flex-start;flex-direction:column}.manage-card>div:last-child{justify-content:flex-start}.lesson-check{flex:none}}
