/* Kotha Academy — management system styles (no build step needed on shared hosting) */
:root{
  --bg:#FBF8F3;--card:#fff;--line:#E9EBF1;--line-2:#F0F1F5;--text:#2B2118;--muted:#667085;--faint:#8A93A6;
  --nav:#2B2118;--nav-2:#3A2D21;--nav-active:#E8710A;--nav-text:#DDD2C5;
  --blue:#E8710A;--blue-d:#C75D05;--blue-bg:#FDEBD7;--accent:#0B78C8;--green:#15803D;--green-bg:#DCFCE7;
  --orange:#B45309;--orange-bg:#FEF3C7;--red:#B91C1C;--red-bg:#FEE2E2;--purple:#6D28D9;--purple-bg:#F3E8FF;
  --hard:#C2410C;--hard-bg:#FFEDD5;--grey:#6B7280;--grey-bg:#F3F4F6;--gold:#D4AF37;
}
*{box-sizing:border-box}
body{margin:0;font-family:"Baloo Da 2",Inter,"Noto Sans Bengali",system-ui,sans-serif;color:var(--text);background:var(--bg);font-size:15px}
a{color:var(--blue);text-decoration:none}a:hover{color:var(--blue-d)}
h1{margin:0;font-size:24px;font-weight:700}h2{margin:0;font-size:16px;font-weight:700}

.shell{min-height:100vh}
.topnav{position:sticky;top:0;z-index:30;background:var(--nav);box-shadow:0 2px 10px rgba(0,0,0,.18)}
.topnav-in{max-width:1280px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px}
.brandbar{display:flex;align-items:center;gap:10px;color:#fff;min-width:0}.brandbar:hover{color:#fff}
.brandbar img{width:40px;height:40px;object-fit:contain;background:#fff;border-radius:12px;padding:3px;flex:none}
.brandbar span{display:flex;flex-direction:column;line-height:1.15;min-width:0}.brandbar b{font-size:19px;white-space:nowrap}.brandbar small{font-size:11px;color:#CDBFAE}
.topnav-right{display:flex;align-items:center;gap:8px}
.who{display:flex;flex-direction:column;text-align:right;line-height:1.2;max-width:200px}.who b{color:#fff;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.who small{color:#F4A259;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbtn{background:var(--nav-2);color:#fff;border:1px solid #4A3A2B;border-radius:10px;padding:7px 12px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.tbtn.out{background:#B91C1C;border-color:#B91C1C}
.pills{max-width:1280px;margin:0 auto;display:flex;gap:8px;overflow-x:auto;padding:4px 18px 12px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.pills::-webkit-scrollbar{display:none}
.pills a{flex:none;display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:999px;background:var(--nav-2);color:var(--nav-text);font-weight:600;font-size:14px;white-space:nowrap}
.pills a:hover{color:#fff;background:#4A3A2B}.pills a.active{background:var(--nav-active);color:#fff}
.pills .count{background:#DC2626;color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:0 7px}
.main{max-width:1280px;margin:0 auto;padding:24px 18px 48px;display:flex;flex-direction:column;gap:22px}
.topbar{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;align-items:center}
.sub{font-size:13px;color:var(--muted)}

.grid-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:14px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:15px 17px;display:flex;flex-direction:column;gap:6px}
.stat span{font-size:11px;color:var(--muted);font-weight:600;letter-spacing:.03em;text-transform:uppercase}.stat b{font-size:24px}
.row{display:flex;flex-wrap:wrap;gap:20px}.row>.card{flex:1 1 380px;min-width:0}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px 20px;display:flex;flex-direction:column;gap:12px}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.list-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0;border-top:1px solid var(--line-2)}
.list-row small{display:block;color:var(--faint);font-size:12px}
.empty{color:var(--faint);font-size:13px;padding:8px 0}

.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;min-width:620px}
th{font-size:11px;color:var(--faint);text-align:left;padding:8px 6px;border-bottom:1px solid var(--line-2);text-transform:uppercase;letter-spacing:.03em}
td{padding:11px 6px;border-bottom:1px solid var(--bg);vertical-align:middle}

.pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;padding:3px 10px;border-radius:999px;white-space:nowrap}
.pill.blue{background:var(--blue-bg);color:var(--blue-d)}.pill.green{background:var(--green-bg);color:var(--green)}
.pill.orange{background:var(--orange-bg);color:var(--orange)}.pill.red{background:var(--red-bg);color:var(--red)}
.pill.purple{background:var(--purple-bg);color:var(--purple)}.pill.grey{background:var(--grey-bg);color:var(--grey)}
.pill.hard{background:var(--hard-bg);color:var(--hard)}
.dot{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700}
.dot::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}
.dot.online{color:#16A34A}.dot.idle{color:var(--orange)}.dot.offline{color:#9CA3AF}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font:inherit;font-size:13px;font-weight:700;padding:9px 14px;border-radius:8px;border:1px solid transparent;cursor:pointer;min-height:40px;background:var(--blue);color:#fff}
.btn:hover{background:var(--blue-d);color:#fff}
.btn.ghost{background:#fff;border-color:var(--line);color:var(--text)}.btn.ghost:hover{background:var(--bg)}
.btn.small{font-size:12px;padding:5px 10px;min-height:32px}
.btn.green{background:#F0FDF4;border-color:#16A34A;color:var(--green)}.btn.danger{background:#FEF2F2;border-color:#DC2626;color:var(--red)}
.actions{display:flex;gap:6px;flex-wrap:wrap}.actions form{margin:0}

.banner{border-radius:12px;padding:13px 17px;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;font-size:13px}
.banner.warn{background:var(--orange-bg);border:1px solid #FDE68A;color:#92400E}
.banner.danger{background:var(--red-bg);border:1px solid #FECACA;color:var(--red)}
.banner.ok{background:var(--green-bg);border:1px solid #BBF7D0;color:var(--green)}
.banner.info{background:#FFF6EC;border:1px solid var(--blue-bg);color:var(--blue-d)}

.bars{display:flex;gap:10px;align-items:flex-start;overflow-x:auto;padding-bottom:4px}
.bar{flex:1 1 0;min-width:46px;display:flex;flex-direction:column;align-items:center;gap:7px}
.bar .track{height:130px;width:100%;display:flex;align-items:flex-end;background:var(--bg);border-radius:8px;overflow:hidden}
.bar .fill{width:100%;border-radius:8px 8px 0 0}
.bar .fill.green{background:var(--green)}.bar .fill.yellow{background:#D97706}.bar .fill.red{background:var(--red)}.bar .fill.none{background:#D1D5DB}
.bar b{font-size:12px}.bar b.green{color:var(--green)}.bar b.yellow{color:var(--orange)}.bar b.red{color:var(--red)}.bar b.none{color:var(--faint)}
.bar small{font-size:11px;color:var(--muted);text-align:center;line-height:1.3;min-height:2.6em}

.task-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr));gap:14px}
.task{background:#fff;border:1px solid var(--line);border-radius:12px;padding:15px 17px;display:flex;flex-direction:column;gap:9px}
.task .meta{display:flex;justify-content:space-between;font-size:12px;color:var(--faint)}

form.stack{display:flex;flex-direction:column;gap:16px;max-width:760px}
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:14px}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=date],input[type=time],input[type=datetime-local],input[type=number],input[type=search],select,textarea{font:inherit;font-weight:400;padding:10px 12px;border:1px solid #D0D5DD;border-radius:8px;background:#fff;min-height:42px}
input:focus,select:focus,textarea:focus{outline:2px solid var(--blue-bg);border-color:var(--blue)}
.check{flex-direction:row;align-items:center;gap:10px;font-weight:500;min-height:36px}
.check input{width:18px;height:18px}
.perm-group{border:1px solid var(--line);border-radius:10px;padding:12px 14px}
.perm-group h3{margin:0 0 6px;font-size:12px;color:var(--faint);text-transform:uppercase;letter-spacing:.04em}
.error{color:var(--red);font-size:12px;font-weight:500}
.muted{color:var(--muted)}.faint{color:var(--faint);font-size:12px}
.secret{font-family:ui-monospace,monospace;background:#fff;padding:2px 8px;border-radius:6px;border:1px solid #BBF7D0}

.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login{width:100%;max-width:400px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:32px 28px;display:flex;flex-direction:column;gap:18px}

@media (max-width:720px){
  .main{padding:20px 16px}.me{margin-top:0}
  .grid-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat b{font-size:20px}
}

/* Orders & files */
.dl{display:grid;grid-template-columns:max-content 1fr;gap:8px 16px;margin:0}
.dl dt{color:var(--faint);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;padding-top:2px}.dl dd{margin:0}
.pre{white-space:pre-line;margin:4px 0 0}
.file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}
.file{border:1px solid var(--line);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:6px;min-width:0}
.file img{width:100%;height:120px;object-fit:cover;border-radius:6px;background:var(--bg);display:block}
.file-ext{height:120px;border-radius:6px;background:var(--bg);display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--faint)}
.file-name{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}
details.inline form{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.drop input[type=file]{padding:18px;border:2px dashed #D0D5DD;border-radius:10px;background:var(--bg);font-weight:400}
.thumbs{display:flex;flex-wrap:wrap;gap:6px}
.thumb{width:56px;height:56px;border-radius:6px;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:var(--faint);overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:cover}
h1 .pill{vertical-align:middle;margin-left:6px}
.nav a .count{margin-left:auto;background:#DC2626;color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:1px 7px}
a.task:hover{border-color:var(--blue)}
.light{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--c)}
.light span{width:11px;height:11px;border-radius:50%;background:var(--c);box-shadow:0 0 0 3px color-mix(in srgb,var(--c) 22%,transparent)}
h1 .light{font-size:14px;vertical-align:middle;margin-left:8px}
[hidden]{display:none!important}

/* Kotha Academy look (same colours and font as the earlier version) */
.hero{background:linear-gradient(135deg,#E8710A,#C75D05);color:#fff;border-radius:16px;padding:22px 26px;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;align-items:center}
.hero small{opacity:.85;display:block}.hero h1{font-size:26px;margin:4px 0}.hero p{margin:0;opacity:.92}
.hero .actions{display:flex;gap:10px;flex-wrap:wrap}
.hero .hbtn{background:#fff;color:#C75D05;border-radius:10px;padding:9px 16px;font-weight:700}.hero .hbtn.alt{background:rgba(255,255,255,.18);color:#fff;border:1px solid rgba(255,255,255,.4)}
.login-logo{text-align:center;margin-bottom:6px}.login-logo img{width:190px;max-width:70%;height:auto}

/* phones */
@media (max-width:640px){
.who{display:none}.brandbar small{display:none}.brandbar b{font-size:17px}
.topnav-in{padding:8px 12px}.pills{padding:2px 12px 10px}.main{padding:14px 12px 40px;gap:16px}
.hero{padding:18px}.hero h1{font-size:22px}
h1{font-size:22px}
}
/* big rounded cards, calmer tables */
.card,.stat{border-radius:18px;box-shadow:0 1px 3px rgba(43,33,24,.06)}
.stat b{font-size:28px}
.hero{border-radius:20px}
h1{font-size:26px}h2{font-size:17px}
th{text-align:left;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
@media (max-width:640px){table{min-width:520px}.table-wrap{border-radius:12px}}
.meter{height:9px;border-radius:999px;background:var(--line-2);overflow:hidden}.meter i{display:block;height:100%;background:linear-gradient(90deg,#F4A259,var(--blue));border-radius:999px}
@keyframes grow{from{width:0}}@keyframes ring{from{stroke-dashoffset:100}}
.chart-top{display:flex;flex-wrap:wrap;gap:22px;align-items:center}
.donut{position:relative;width:130px;height:130px;flex:none}.donut svg{width:100%;height:100%;transform:rotate(-90deg)}
.donut circle{fill:none;stroke-width:13}.donut .bg{stroke:var(--line-2)}
.donut .fg{stroke:var(--blue);stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:calc(100 - var(--p));animation:ring 1.2s cubic-bezier(.2,.8,.2,1)}
.donut>div{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;font-weight:700}
.donut b{font-size:28px;line-height:1}.donut small{font-size:11px;color:var(--muted);font-weight:500}
.kpis{flex:1;display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}
.kpis div{background:var(--bg);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column}.kpis span{font-size:12px;color:var(--muted)}.kpis b{font-size:26px}
.wbar{display:flex;flex-direction:column;gap:5px;padding:10px 0;border-top:1px solid var(--line-2)}
.wbar-head{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.wtrack{display:flex;gap:3px;height:14px;background:var(--line-2);border-radius:999px;overflow:hidden}
.wtrack i{display:block;height:100%;width:var(--w);border-radius:999px;animation:grow 1s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--d,0s)}
.wtrack i.o,.legend i.o{background:#0B78C8}.wtrack i.t,.legend i.t{background:linear-gradient(90deg,#F4A259,var(--blue))}
.legend{display:flex;gap:16px;font-size:12px;color:var(--muted)}.legend i{display:inline-block;width:12px;height:12px;border-radius:4px;margin-right:6px;vertical-align:middle}
@media (prefers-reduced-motion:reduce){.wtrack i,.donut .fg{animation:none}}
@media (prefers-reduced-motion:reduce){.wtrack i,.donut .fg{animation:none}}
/* phone: ☰ menu like before */
.menu-btn{display:none;font-size:20px;line-height:1;padding:6px 12px}
@media (max-width:640px){
.menu-btn{display:inline-block}
.pills{display:none}
.pills.open{display:flex;flex-direction:column;gap:4px;overflow:visible;max-height:calc(100vh - 70px);overflow-y:auto;padding:6px 12px 14px;background:var(--nav);box-shadow:0 10px 20px rgba(0,0,0,.25)}
.pills.open a{border-radius:12px;padding:12px 16px;font-size:15px;background:transparent}
.pills.open a.active{background:var(--nav-active)}
.topnav-right{gap:6px}.tbtn{padding:7px 10px}
}
/* phone header: ☰ left, name visible, buttons inside menu */
.menu-extra{display:none}
@media (max-width:640px){
.topnav-in{justify-content:flex-start}
.topnav-right{margin-left:auto;min-width:0}
.hdr-act{display:none}
.who{display:flex;max-width:130px}.who b{font-size:13px}.who small{font-size:10px}
.brandbar img{width:34px;height:34px}.brandbar b{font-size:16px}
.pills.open .menu-extra{display:flex;gap:8px;padding-top:10px;margin-top:6px;border-top:1px solid #4A3A2B}
.menu-extra form{flex:1}.menu-extra .tbtn{width:100%;padding:10px}
}
@media (max-width:360px){.brandbar b{display:none}}
/* v12: desktop menu wraps (nothing cut off); phone menu = side drawer like before */
@keyframes drawer{from{transform:translateX(-105%)}}
@media (min-width:641px){.pills{flex-wrap:wrap;overflow:visible;row-gap:8px}}
@media (max-width:640px){
.pills.open{position:fixed;left:0;top:0;bottom:0;width:270px;max-width:82vw;max-height:none;z-index:60;flex-direction:column;flex-wrap:nowrap;gap:2px;overflow-y:auto;padding:16px 12px;background:var(--nav);box-shadow:0 0 0 100vmax rgba(0,0,0,.45);animation:drawer .2s ease-out}
.pills.open a{padding:9px 12px;font-size:14px;border-radius:9px;flex:none}
.pills.open::before{content:"Kotha Academy";color:#fff;font-weight:700;font-size:17px;padding:2px 12px 12px;border-bottom:1px solid #4A3A2B;margin-bottom:6px}
.pills.open .menu-extra{margin-top:auto}
}
/* v13: dashboard quick-menu tiles */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}
.tile{position:relative;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px 12px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;color:var(--text);font-weight:600;font-size:14px;line-height:1.25;box-shadow:0 1px 3px rgba(43,33,24,.06);transition:transform .12s,border-color .12s}
.tile:hover{border-color:var(--blue);color:var(--blue-d);transform:translateY(-2px)}
.tile .ti{width:46px;height:46px;border-radius:14px;background:var(--blue-bg);display:flex;align-items:center;justify-content:center;font-size:23px}
.tile .count{position:absolute;top:8px;right:8px;background:#DC2626;color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:1px 7px}
@media (max-width:640px){.tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.tile{padding:12px 6px;font-size:12.5px;border-radius:14px}.tile .ti{width:40px;height:40px;font-size:20px}}
/* v14: dashboard graph section */
@keyframes rise{from{height:0}}@keyframes spin{from{transform:rotate(-90deg) scale(.6);opacity:0}}
.dcharts{display:flex;flex-direction:column;gap:14px;margin-top:8px}
.dgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr));gap:16px}
.vbars{display:flex;align-items:flex-end;gap:8px;height:170px;padding-top:6px}
.vbar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;min-width:0}
.vbar i{display:block;width:100%;max-width:34px;height:var(--h);border-radius:8px 8px 4px 4px;background:linear-gradient(180deg,#F4A259,var(--blue));animation:rise .9s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--d,0s)}
.vbars.rep .vbar i{background:linear-gradient(180deg,#5BB3F0,#0B78C8)}
.vbar b{font-size:12px}.vbar span{font-size:11px;color:var(--muted)}
.pie{width:130px;height:130px;border-radius:50%;flex:none;position:relative;background:conic-gradient(#16A34A 0 var(--e),#F59E0B var(--e) var(--m),#DC2626 var(--m) 100%);animation:spin .9s cubic-bezier(.2,.8,.2,1)}
.pie>div{position:absolute;inset:22px;border-radius:50%;background:var(--card);display:flex;flex-direction:column;align-items:center;justify-content:center}
.pie b{font-size:26px;line-height:1}.pie small{font-size:11px;color:var(--muted)}
.legend.col{flex-direction:column;gap:8px;font-size:13px;color:var(--text)}
@media (prefers-reduced-motion:reduce){.vbar i,.pie{animation:none}}
/* v15: one-line menu with dropdown groups, bell in header */
.pills{flex-wrap:nowrap;overflow:visible}
.pgroup{position:relative;flex:none}
.pgroup>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:999px;background:var(--nav-2);color:var(--nav-text);font-weight:600;font-size:14px;white-space:nowrap;user-select:none}
.pgroup>summary::-webkit-details-marker{display:none}
.pgroup>summary:hover,.pgroup[open]>summary{color:#fff;background:#4A3A2B}
.pgroup[data-active]>summary{background:var(--nav-active);color:#fff}
.pgroup>summary span{font-size:11px;opacity:.8}
.pmenu{position:absolute;top:calc(100% + 6px);left:0;z-index:50;min-width:210px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 30px rgba(43,33,24,.18);padding:6px;display:flex;flex-direction:column;gap:2px}
.pmenu a{padding:9px 12px;border-radius:9px;color:var(--text);font-weight:600;font-size:14px;white-space:nowrap}
.pmenu a:hover{background:var(--blue-bg);color:var(--blue-d)}.pmenu a.active{background:var(--nav-active);color:#fff}
.tbtn.bell{position:relative;font-size:16px;padding:6px 10px;line-height:1}
.tbtn.bell .count{position:absolute;top:-6px;right:-6px;background:#DC2626;color:#fff;font-size:10px;font-weight:700;border-radius:999px;padding:1px 6px}
@media (min-width:641px) and (max-width:1180px){.pills{flex-wrap:wrap}}
@media (max-width:640px){
.pills.open .pgroup{width:100%}
.pills.open .pgroup>summary{background:transparent;color:#B9A894;font-size:11px;text-transform:uppercase;letter-spacing:.06em;padding:12px 12px 4px;pointer-events:none}
.pills.open .pgroup>summary span{display:none}
.pills.open .pmenu{position:static;background:transparent;border:0;box-shadow:none;padding:0;min-width:0}
.pills.open .pmenu a{color:var(--nav-text);padding:9px 12px}.pills.open .pmenu a.active{color:#fff}
}
.pills .pmenu a{background:transparent;color:var(--text);border-radius:9px;padding:9px 12px;display:block}
.pills .pmenu a:hover{background:var(--blue-bg);color:var(--blue-d)}.pills .pmenu a.active{background:var(--nav-active);color:#fff}
@media (max-width:640px){.pills.open .pmenu a{color:var(--nav-text)}.pills.open .pmenu a:hover{background:var(--nav-2);color:#fff}.pills.open .pmenu a.active{background:var(--nav-active);color:#fff}}
/* v16 chat + notice board */
.tbtn.bell .count[hidden]{display:none}
.chat{display:grid;grid-template-columns:320px 1fr;height:calc(100dvh - 190px);min-height:460px;background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:0 1px 3px rgba(43,33,24,.06)}
.chat-list{display:flex;flex-direction:column;border-right:1px solid var(--line);min-height:0;background:#FFFCF8}
.chat-list-head{display:flex;flex-direction:column;gap:10px;padding:14px 14px 8px}
.chat-list-head h1{font-size:20px}
.chat-new{display:flex;gap:8px;flex-wrap:wrap}
.chat-search{margin:0 14px 8px}
.chat-items{overflow-y:auto;flex:1;min-height:0}
.citem{display:flex;gap:10px;align-items:center;padding:10px 14px;color:var(--text);border-top:1px solid var(--line-2)}
.citem:hover{background:var(--bg);color:var(--text)}.citem.active{background:var(--blue-bg)}
.citem .cmeta{flex:1;min-width:0;display:flex;flex-direction:column}
.citem .cmeta b{font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.citem .cmeta small{color:var(--faint);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.citem.has-unread .cmeta small{color:var(--text);font-weight:600}
.citem .cside{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.citem .cside small{color:var(--faint);font-size:11px;white-space:nowrap}
.chat .count{background:#DC2626;color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:0 7px;min-width:20px;text-align:center}
.av{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--blue);color:#fff;font-weight:700;font-size:17px}
.av.grp{background:var(--accent);font-size:18px}
.cpop{position:relative}.cpop>summary{list-style:none;cursor:pointer}.cpop>summary::-webkit-details-marker{display:none}
.cpop-body{position:absolute;z-index:20;top:calc(100% + 6px);left:0;width:300px;max-width:85vw;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 30px rgba(0,0,0,.15);padding:12px;display:flex;flex-direction:column;gap:10px}
.cpop.right .cpop-body{left:auto;right:0}
.cpop-body form{display:flex;flex-direction:column;gap:8px}
.people{max-height:300px;overflow-y:auto;display:flex;flex-direction:column}
.person button{display:flex;gap:10px;align-items:center;width:100%;background:none;border:0;padding:7px 4px;border-radius:10px;cursor:pointer;font:inherit;text-align:left}
.person button:hover{background:var(--bg)}.person span:last-child{display:flex;flex-direction:column}.person small{color:var(--faint);font-size:11.5px}
.person .av{width:34px;height:34px;font-size:15px}
.picks .pick{flex-direction:row;align-items:center;gap:8px;font-weight:500;padding:5px 2px}.pick small{color:var(--faint);font-weight:400}
.chat-pane{display:flex;flex-direction:column;min-height:0;min-width:0;position:relative;background:#F7F2EA}
.chat-pane.drop{outline:3px dashed var(--blue);outline-offset:-8px}
.chat-head{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#fff;border-bottom:1px solid var(--line)}
.chat-head .back{display:none;font-size:22px;padding:0 6px;color:var(--text)}
.chat-title{flex:1;min-width:0;display:flex;flex-direction:column}.chat-title b{font-size:15.5px}
.chat-title small{color:var(--faint);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msgs{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:6px;min-height:0}
.msgs .older{align-self:center}
.daysep{align-self:center;background:#fff;color:var(--muted);font-size:11.5px;font-weight:600;padding:3px 12px;border-radius:999px;margin:8px 0;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.sysmsg{align-self:center;color:var(--muted);font-size:12px;background:#FFF6EC;padding:4px 12px;border-radius:999px;text-align:center;max-width:90%}
.msg{position:relative;align-self:flex-start;max-width:min(75%,520px);background:#fff;border-radius:4px 14px 14px 14px;padding:7px 11px 5px;box-shadow:0 1px 2px rgba(0,0,0,.07);display:flex;flex-direction:column;gap:4px;word-wrap:break-word;overflow-wrap:anywhere}
.msg.mine{align-self:flex-end;background:#FDE3C6;border-radius:14px 4px 14px 14px}
.msg .who{font-size:12px;color:var(--accent)}
.msg .txt{font-size:14.5px;line-height:1.45}
.msg img{max-width:100%;max-height:320px;border-radius:10px;display:block}
.msg video{max-width:100%;max-height:320px;border-radius:10px}
.msg .voice{display:flex;align-items:center;gap:6px}.msg .voice audio{height:36px;max-width:240px}.msg .voice small{color:var(--muted);font-size:11px}
.fcard{display:flex;flex-direction:column;gap:2px;background:rgba(0,0,0,.04);border-radius:10px;padding:8px 10px;color:var(--text);font-weight:600;font-size:13px}
.fcard small{color:var(--muted);font-weight:500;font-size:11.5px}
.msg .meta{align-self:flex-end;font-size:10.5px;color:var(--faint);display:flex;gap:4px;align-items:center}
.tick{color:var(--faint);letter-spacing:-3px;padding-right:3px}.tick.half{color:#9CA3AF}.tick.read{color:#0B78C8}
.msg .gone{color:var(--faint);font-size:13px}
.mdel{position:absolute;top:-8px;left:-8px;width:22px;height:22px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--red);font-size:11px;cursor:pointer;display:none}
.msg.mine:hover .mdel{display:block}
@media (pointer:coarse){.msg.mine .mdel{display:block;opacity:.55}}
.newpill{position:absolute;bottom:84px;left:50%;transform:translateX(-50%);border:0;background:var(--blue);color:#fff;font:inherit;font-weight:700;font-size:12.5px;padding:6px 14px;border-radius:999px;box-shadow:0 4px 12px rgba(0,0,0,.2);cursor:pointer}
.newpill[hidden]{display:none}
.uploads{display:flex;flex-direction:column;gap:4px;padding:0 14px}
.uprow{display:flex;align-items:center;gap:10px;background:#fff;border-radius:10px;padding:6px 10px;font-size:12.5px}
.uprow span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uprow progress{width:120px}.uprow.bad{color:var(--red)}
.composer{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;background:#fff;border-top:1px solid var(--line)}
.composer[hidden]{display:none}
.composer textarea{flex:1;resize:none;min-height:42px;max-height:140px;border-radius:22px;padding:10px 14px;font-size:14.5px}
.cbtn{flex:none;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--line);background:#fff;font-size:18px;cursor:pointer;padding:0}
.cbtn.send{background:var(--blue);color:#fff;border-color:var(--blue)}
.recbar{display:flex;align-items:center;gap:10px;padding:12px 14px;background:#fff;border-top:1px solid var(--line)}
.recbar[hidden]{display:none}
.recbar .dot{width:12px;height:12px;border-radius:50%;background:#DC2626;animation:recblink 1s infinite}
.recbar .muted{flex:1}
@keyframes recblink{50%{opacity:.25}}
.chat-empty{margin:auto;text-align:center;max-width:360px;padding:30px;display:flex;flex-direction:column;gap:8px;align-items:center}
.chat-empty>div{font-size:48px}
@media (max-width:760px){
  .main:has(.chat){padding:0 0 0;gap:0}
  .chat{grid-template-columns:1fr;height:calc(100dvh - 64px);border-radius:0;border:0}
  .chat.open .chat-list{display:none}
  .chat:not(.open) .chat-pane{display:none}
  .chat-head .back{display:block}
  .msg{max-width:85%}
}
/* notice board */
.notice-new summary{cursor:pointer}
.notice-new .stack{display:flex;flex-direction:column;gap:12px;margin-top:12px}
label.check{flex-direction:row;align-items:center;gap:8px;font-weight:500}
.notice.important{border-color:#FECACA;background:#FFFBFB}
.notice-body{font-size:14.5px;line-height:1.6}
.notice-img{max-width:100%;max-height:360px;border-radius:12px}
.notice .row{align-items:center;gap:10px}
.notice-banner b{font-weight:700}
/* v17 smart chat: fits the screen, floating window, WhatsApp-style bubbles */
body.chatpage{height:var(--vh,100dvh);overflow:hidden}
body.chatpage .shell{height:100%;min-height:0;display:flex;flex-direction:column}
body.chatpage .main{flex:1;min-height:0;width:100%;padding-bottom:16px}
body.chatpage .chat{flex:1;height:auto;min-height:0}
body.embed{margin:0;display:flex;flex-direction:column;background:#fff}
body.embed .banner.mini{border-radius:0;padding:7px 12px;font-size:12.5px}
body.embed .chat{flex:1;height:auto;min-height:0;border:0;border-radius:0;box-shadow:none}
.chat.compact{grid-template-columns:1fr}
.chat.compact.open .chat-list{display:none}
.chat.compact:not(.open) .chat-pane{display:none}
.chat.compact .chat-head .back{display:block}
.chat.compact .chat-list-head h1{display:none}
.chat.compact .msg{max-width:85%}
.chat.compact .chat-head{padding:8px 10px}
.chat.compact .composer{padding:8px}
.av{position:relative}
.av .on{position:absolute;right:0;bottom:0;width:12px;height:12px;border-radius:50%;background:#22C55E;border:2px solid #fff}
.chat-title small.online{color:#16A34A;font-weight:600}
/* bubbles: tails and grouping */
.msg{margin-top:4px}
.msg::before{content:"";position:absolute;top:0;left:-6px;border-width:0 8px 8px 0;border-style:solid;border-color:transparent #fff transparent transparent}
.msg.mine::before{left:auto;right:-6px;border-width:0 0 8px 8px;border-color:transparent transparent transparent #FDE3C6}
.msg.cont{margin-top:-3px;border-top-left-radius:14px}
.msg.mine.cont{border-top-right-radius:14px}
.msg.cont::before,.msg.cont .who{display:none}
.msg .mdel{top:-6px}
.msgs{background:#EFE7DD url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='10' cy='10' r='1.3' fill='%23d9cbb8'/%3E%3Ccircle cx='50' cy='45' r='1.1' fill='%23d9cbb8'/%3E%3C/svg%3E")}
.keepnote{font-size:11.5px}
/* mic turns into send while typing */
.composer .cbtn.send{display:none}
.composer.typing .cbtn.send{display:grid}
.composer.typing .cbtn.mic{display:none}
.composer textarea{background:#F7F7F7}
/* photo viewer */
.lightbox{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.88);display:grid;place-items:center;padding:20px}
.lightbox[hidden]{display:none}
.lightbox img{max-width:100%;max-height:100%;border-radius:8px;object-fit:contain}
.lightbox .lbx,.lightbox .lbdl{position:absolute;top:14px;width:42px;height:42px;border-radius:50%;border:0;background:rgba(255,255,255,.15);color:#fff;font-size:18px;display:grid;place-items:center;cursor:pointer}
.lightbox .lbx{right:14px}.lightbox .lbdl{right:66px}
/* floating chat button + window */
.chatfab{position:fixed;right:22px;bottom:calc(22px + env(safe-area-inset-bottom));z-index:60;width:60px;height:60px;border-radius:50%;border:0;background:var(--blue);color:#fff;font-size:26px;cursor:pointer;box-shadow:0 8px 24px rgba(232,113,10,.45);display:grid;place-items:center;transition:transform .15s}
.chatfab:hover{transform:scale(1.07)}
.chatfab.hide{display:none}
.chatfab .count{position:absolute;top:-2px;right:-2px;background:#DC2626;color:#fff;font-size:12px;font-weight:700;border-radius:999px;padding:1px 7px;border:2px solid #fff}
.chatfab .count[hidden]{display:none}
.chatpanel{position:fixed;right:22px;bottom:22px;z-index:61;width:380px;height:min(600px,calc(100vh - 110px));background:#fff;border-radius:18px;box-shadow:0 18px 50px rgba(0,0,0,.28);display:none;flex-direction:column;overflow:hidden;border:1px solid var(--line)}
.chatpanel.open{display:flex;animation:cpin .18s ease-out}
@keyframes cpin{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:none}}
.cphead{display:flex;align-items:center;gap:8px;padding:9px 12px;background:var(--nav);color:#fff}
.cphead b{flex:1;font-size:15px}
.cphead a,.cphead button{color:#fff;background:var(--nav-2);border:0;border-radius:8px;width:32px;height:32px;display:grid;place-items:center;font-size:15px;cursor:pointer}
.chatpanel iframe{flex:1;border:0;width:100%;min-height:0}
@media (max-width:760px){
  .chatfab{right:16px;bottom:calc(16px + env(safe-area-inset-bottom));width:56px;height:56px}
  .chatpanel{inset:0;width:auto;height:var(--vh,100dvh);border-radius:0;border:0}
  body.chatpage .main{padding-bottom:0}
}
body:not(.chatpage) .main{padding-bottom:96px}
/* v18 office rules: selfie camera, location chips, presence checks, work-time report */
.selfie-modal{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.7);display:grid;place-items:center;padding:16px}
.selfie-box{background:#fff;border-radius:18px;padding:16px;width:min(420px,100%);display:flex;flex-direction:column;gap:12px;align-items:center;text-align:center}
.selfie-box video{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:14px;background:#111;transform:scaleX(-1)}
.selfie-box.nocam video{display:none}
.selfie-actions{display:flex;gap:10px;justify-content:center;width:100%}.selfie-actions .btn{flex:1}
.selfie-thumb{width:38px;height:38px;border-radius:50%;object-fit:cover;border:2px solid var(--line);flex:none}
.selfie-thumb.big{width:52px;height:52px}
.locchip{display:inline-block;font-size:11.5px;font-weight:600;padding:1px 8px;border-radius:999px;background:var(--bg);color:var(--muted);white-space:nowrap}
.locchip.in{background:#DCFCE7;color:#166534}.locchip.out{background:#FEE2E2;color:#B91C1C}
.presence-banner{display:block;color:#B91C1C;text-decoration:none;animation:recblink 1.6s infinite}
.presence-card{max-width:440px;margin:30px auto;text-align:center;display:flex;flex-direction:column;gap:12px;align-items:center}
.presence-icon{font-size:52px}.countdown{font-size:42px;font-weight:800;color:#B91C1C;font-variant-numeric:tabular-nums;margin:0}
.btn.big{font-size:17px;padding:14px 22px}.big-ok{font-size:18px;color:#166534;font-weight:700}.big-bad{font-size:18px;color:#B91C1C;font-weight:700}
.rules-table th,.rules-table td{text-align:center}.rules-table th:first-child,.rules-table td:first-child{text-align:left}
.rules-table input[type=checkbox]{width:20px;height:20px}
.wt-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:var(--muted);margin:4px 0 12px}
.sw{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.sw.work,.wt-bar .work{background:#16A34A}.sw.nowork,.wt-bar .nowork{background:#CBD5E1}.sw.wait,.wt-bar .wait{background:#F59E0B}.sw.idle,.wt-bar .idle{background:#DC2626}
.wt-list{display:flex;flex-direction:column;gap:12px}
.wt-card{padding:14px 16px}
.wt-head{display:flex;gap:12px;align-items:center}
.wt-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.wt-big{text-align:right;display:flex;flex-direction:column}.wt-big b{font-size:20px;color:#166534}
.wt-bar{display:flex;height:12px;border-radius:999px;overflow:hidden;background:var(--bg);margin:12px 0 8px}
.wt-bar i{display:block;height:100%;transition:width .8s ease}
.wt-nums{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}.wt-nums .warn{color:#B91C1C;font-weight:700}
.wt-checks{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.chk{display:inline-flex;align-items:center;gap:6px;font-size:12px;background:var(--bg);border-radius:999px;padding:3px 10px 3px 3px}
.chk img{width:26px;height:26px;border-radius:50%;object-fit:cover}
.chk.missed{background:#FEE2E2;padding-left:10px}
@media (max-width:760px){.wt-head{flex-wrap:wrap}.wt-big{text-align:left;width:100%}}

/* App Settings (p25) */
.as-tabs{margin:4px 0 14px;flex-wrap:wrap}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.brandpick{display:flex;flex-direction:column;gap:8px;padding:12px;border:1px dashed var(--line);border-radius:12px}
.brandpick img{width:56px;height:56px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:12px;padding:4px}
.presets{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:10px}
.preset{position:relative;flex-direction:column;align-items:center;gap:6px;padding:10px 8px;border:2px solid var(--line);border-radius:14px;cursor:pointer;text-align:center;font-weight:600;font-size:12px}
.preset input{position:absolute;opacity:0;pointer-events:none}
.preset .sw{width:44px;height:44px;border-radius:50%;box-shadow:inset 0 0 0 2px rgba(255,255,255,.6)}
.preset:has(input:checked){border-color:var(--blue);background:var(--blue-bg)}
.colorgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.colorfield span{display:flex;align-items:center;gap:8px}
.colorfield input[type=color]{width:46px;height:34px;padding:2px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer}
.colorfield code{font-size:12px;color:var(--muted)}
.previewbox{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px;border-radius:12px;background:var(--bg)}
label.check.big{font-size:15px;font-weight:700}
.composer.novoice .cbtn.mic{display:none}.composer.novoice .cbtn.send{display:grid}
.topnav-right{min-width:0}.who{min-width:0;overflow:hidden}
