:root {
  --ink: #173129;
  --muted: #6b7e76;
  --paper: #f4f1e9;
  --panel: #fffdf7;
  --line: #e1e4db;
  --green: #1e5947;
  --green-dark: #10251f;
  --mint: #d7eadf;
  --gold: #e8b75e;
  --rose: #f2d8cd;
  --blue: #d9e8ef;
  --shadow: 0 18px 45px rgba(23, 49, 41, .08);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--green-dark); }
.login-story { padding: clamp(1.2rem, 4vw, 4.5rem); color: #f5f0e5; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 70% 20%, rgba(232,183,94,.22), transparent 35%), var(--green-dark); }
.login-pane-card { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.login-stat-card { width: min(620px, 100%); margin: auto; padding: clamp(1.5rem, 4vw, 3.5rem); border: 1px solid rgba(255,255,255,.12); border-radius: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.18); }
.story-stat-card { background: rgba(16,37,31,.36); text-align: center; }
.sign-in-stat-card { border-color: var(--line); background: rgba(255,253,247,.88); }
.login-card-center { display: grid; justify-items: center; text-align: center; }
.login-card-center > p { max-width: 430px; }
.eyebrow { color: var(--gold); font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.login-story h1 { max-width: 680px; margin: 1rem 0; font-family: Georgia, serif; font-size: clamp(2.8rem, 6vw, 5.8rem); line-height: .92; letter-spacing: -.06em; font-weight: 500; }
.login-story p { max-width: 520px; color: #c8d5cd; font-size: 1.05rem; line-height: 1.65; }
.story-foot { color: #96aea1; font-size: .83rem; max-width: 430px; line-height: 1.6; }
.login-card { padding: clamp(1.2rem, 4vw, 4.5rem); display: flex; align-items: center; background: var(--paper); }
.login-panel { width: min(420px, 100%); }
.login-panel.login-stat-card { width: min(520px, 100%); }
.login-footer { display: grid; justify-items: center; gap: .4rem; color: #91a59a; text-align: center; font-size: .68rem; line-height: 1.4; }
.login-card .login-footer { color: var(--muted); }
.login-footer img { width: 142px; height: auto; max-height: 42px; object-fit: contain; }
.login-feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 490px; margin-top: 1.7rem; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; overflow: hidden; }
.login-feature-strip span { padding: .75rem .5rem; color: #b3c8bc; font-size: .68rem; border-right: 1px solid rgba(255,255,255,.12); }
.login-feature-strip span:last-child { border-right: 0; }
.login-feature-strip b { display: block; color: var(--gold); font-size: 1rem; margin-bottom: .15rem; }
.brand { display: flex; gap: .75rem; align-items: center; font-weight: 800; letter-spacing: .04em; }
.brand-logo { width: 58px; height: 42px; object-fit: contain; border-radius: 9px; background: white; }
.brand-name { display: block; font-weight: 900; letter-spacing: .04em; }
.brand small { display: block; margin-top: .15rem; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--green-dark); background: var(--gold); font-weight: 900; }
.story-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; }
.story-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; background: white; }
.story-brand img:nth-child(2) { width: 56px; height: 48px; border-radius: 8px; }
.story-brand strong, .story-brand span { display: block; }
.story-brand strong { color: white; font-size: .9rem; }
.story-brand span { margin-top: .18rem; color: #9cb4a8; font-size: .7rem; }
.division-lockup { display: grid; grid-template-columns: 54px minmax(0, 1fr) 54px; align-items: center; gap: .75rem; text-align: center; }
.division-lockup img { width: 54px; height: 54px; padding: .22rem; object-fit: contain; border-radius: 50%; background: white; }
.division-lockup img:last-child { border-radius: 10px; }
.division-lockup strong, .division-lockup span { display: block; }
.division-lockup strong { color: var(--ink); font-size: .9rem; letter-spacing: .01em; }
.division-lockup span { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.story-lockup { width: min(360px, 100%); margin-bottom: 2rem; }
.story-lockup strong { color: white; }
.story-lockup span { color: #9cb4a8; }
.product-lockup { display: grid; justify-items: center; gap: .4rem; margin: 0 auto; text-align: center; }
.product-logo { width: 86px; height: 62px; object-fit: contain; border-radius: 12px; background: white; }
.product-name { display: block; color: var(--ink); font-size: 1.15rem; font-weight: 900; letter-spacing: .05em; }
.product-lockup small { display: block; margin-top: .12rem; color: var(--muted); font-size: .75rem; font-weight: 600; }
.login-panel h2 { font-family: Georgia, serif; font-size: 2.1rem; font-weight: 500; margin: 2rem 0 .5rem; }
.muted { color: var(--muted); }
.login-form { margin-top: 2rem; }
.login-form .field { width: 100%; text-align: left; }
.pin-field { display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
.pin-field input { min-width: 0; }
.remember-role { display: flex; align-items: center; gap: .45rem; width: 100%; margin: .2rem 0 1rem; color: var(--muted); font-size: .74rem; text-align: left; }
.remember-role input { accent-color: var(--green); }
.field { display: grid; gap: .42rem; margin-bottom: 1rem; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: .85rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,89,71,.13); }
.btn { border: 0; border-radius: 9px; padding: .75rem 1rem; font-weight: 700; color: var(--green-dark); background: var(--mint); transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--green); color: white; }
.btn.dark { background: var(--green-dark); color: white; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { color: #8a1f1f; border-color: #d9a4a4; background: #fff7f7; }
.btn.small { padding: .55rem .75rem; font-size: .82rem; }
.login-hint { margin-top: 1.4rem; padding: .9rem; border-radius: 12px; background: #ede9df; color: #637269; font-size: .78rem; line-height: 1.5; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; transition: grid-template-columns .2s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: 0 1fr; }
.sidebar { color: #d5e1da; background: var(--green-dark); padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 2rem; }
.sidebar .brand { color: white; padding: 0 .55rem; }
.sidebar .brand small { color: #87a096; }
.sidebar .brand { position: relative; }
.brand-copy { min-width: 0; }
.sidebar-toggle { position: fixed; z-index: 45; top: 70px; left: 258px; margin: 0; width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.7); border-radius: 50%; color: white; background: var(--green); box-shadow: 0 8px 24px rgba(0,0,0,.28); font-size: 1rem; transition: left .2s ease; }
.sidebar-toggle:hover { color: white; background: rgba(255,255,255,.14); }
.app-shell.sidebar-collapsed .sidebar { width: 0; min-width: 0; padding: 0; overflow: visible; background: transparent; }
.app-shell.sidebar-collapsed .sidebar > *:not(.brand), .app-shell.sidebar-collapsed .brand > *:not(.sidebar-toggle) { display: none; }
.app-shell.sidebar-collapsed .brand { display: block; margin: 0; padding: 0; }
.app-shell.sidebar-collapsed .sidebar-toggle { left: 12px; }
.app-shell.sidebar-collapsed .brand { justify-content: center; padding: 0; }
.app-shell.sidebar-collapsed .brand-copy, .app-shell.sidebar-collapsed .nav-caption, .app-shell.sidebar-collapsed .menu-group-button span:not(.nav-icon):not(.group-chevron), .app-shell.sidebar-collapsed .nav-group-items button:not(.active) span:not(.nav-icon), .app-shell.sidebar-collapsed .user-copy, .app-shell.sidebar-collapsed .logout-label { display: none; }
.app-shell.sidebar-collapsed .menu-group-button { grid-template-columns: 1fr; justify-items: center; padding-left: .4rem; padding-right: .4rem; }
.app-shell.sidebar-collapsed .menu-group-button .group-chevron { display: none; }
.app-shell.sidebar-collapsed .nav-group-items { margin-left: 0; padding-left: 0; border-left: 0; }
.app-shell.sidebar-collapsed .nav-group-items button { justify-content: center; padding-left: .4rem; padding-right: .4rem; }
.app-shell.sidebar-collapsed .nav-group-items button.active { display: flex; }
.app-shell.sidebar-collapsed .sidebar-bottom { padding: .55rem; }
.app-shell.sidebar-collapsed .user-mini { justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-bottom .btn { font-size: 0; padding-left: .55rem; padding-right: .55rem; }
.app-shell.sidebar-collapsed .logout-icon { display: inline; font-size: .9rem; }
.logout-icon { display: none; }
.sidebar-logo { width: 42px; height: 42px; border-radius: 50%; }
.nav-caption { margin: 0 .65rem -.9rem; color: #779287; font-size: .67rem; font-weight: 800; letter-spacing: .14em; }
.nav { display: grid; gap: .28rem; min-width: 0; }
.nav-label { margin: 1rem .65rem .4rem; color: #779287; font-size: .67rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.menu-group-button { width: 100%; display: grid; grid-template-columns: 19px minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .72rem .7rem; border: 1px solid transparent; border-radius: 10px; color: #afc2b9; background: transparent; text-align: left; }
.menu-group-button:hover, .menu-group-button.active { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.07); }
.menu-group-button strong, .menu-group-button small { display: block; }
.menu-group-button strong { font-size: .82rem; }
.menu-group-button small { margin-top: .18rem; color: #779287; font-size: .67rem; font-weight: 500; }
.menu-group-button.active small { color: #b2c8bc; }
.group-chevron { color: #87a096; font-size: .9rem; }
.nav-group-items { display: grid; gap: .18rem; margin: -.05rem 0 .18rem 1.35rem; padding-left: .55rem; border-left: 1px solid rgba(255,255,255,.13); }
.nav button { display: flex; align-items: center; gap: .7rem; padding: .72rem .7rem; border: 0; border-radius: 9px; color: #afc2b9; background: transparent; text-align: left; font-size: .86rem; }
.nav button:hover, .nav button.active { color: white; background: rgba(255,255,255,.1); }
.nav-icon { width: 19px; text-align: center; opacity: .9; }
.nav-group-items button { padding: .58rem .65rem; font-size: .8rem; }
.selected-menu-group { display: grid; gap: .3rem; }
.return-menu-groups { margin-top: .55rem; border-top: 1px solid rgba(255,255,255,.13) !important; padding-top: .85rem !important; color: #d4e4da !important; font-size: .76rem !important; }
.return-menu-groups:hover { color: white !important; background: rgba(255,255,255,.08) !important; }
.sidebar-bottom { margin-top: auto; padding: .9rem; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; }
.user-mini { display: flex; gap: .65rem; align-items: center; margin-bottom: .8rem; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--gold); font-size: .76rem; font-weight: 800; }
.user-mini strong { display: block; color: white; font-size: .8rem; }
.user-mini span { color: #87a096; font-size: .7rem; }
.sidebar-bottom .btn { width: 100%; color: #bcd0c5; border-color: rgba(255,255,255,.14); }

.main { min-width: 0; }
.topbar { min-height: 76px; padding: 1rem clamp(1rem, 3vw, 2.5rem); display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); background: rgba(255,253,247,.78); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.topbar h2 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: .7rem; }
.connection { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .76rem; }
.license-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border: 1px solid #cfe0d4; border-radius: 10px; color: var(--green-dark); background: #edf6f0; text-align: left; cursor: pointer; }
.license-chip > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: white; background: var(--green); font-size: .7rem; }
.license-chip b, .license-chip small { display: block; }
.license-chip b { font-size: .7rem; line-height: 1.1; }
.license-chip small { margin-top: .13rem; color: var(--muted); font-size: .61rem; }
.license-chip.attention { border-color: #e8c2b2; background: #fff0eb; color: #945338; }
.license-chip.attention > span:first-child { background: #be654b; }
.icon-button { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--green-dark); background: var(--panel); font-size: 1rem; cursor: pointer; }
.icon-button:hover, .license-chip:hover { border-color: #9fc4ad; box-shadow: 0 3px 12px rgba(22,52,41,.08); }
.notification-button i { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; display: grid; place-items: center; border: 2px solid var(--panel); border-radius: 50%; color: white; background: #be654b; font-size: .55rem; font-style: normal; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #40a46e; box-shadow: 0 0 0 4px rgba(64,164,110,.13); }
.dot.offline { background: #cf764e; box-shadow: 0 0 0 4px rgba(207,118,78,.13); }
.content { padding: clamp(1rem, 3vw, 2.5rem); max-width: 1500px; }
.page-intro { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.7rem; }
.page-intro h1 { margin: 0 0 .35rem; font-family: Georgia, serif; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; letter-spacing: -.035em; }
.page-intro p { margin: 0; color: var(--muted); font-size: .9rem; }
.workflow-rail { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .8rem; margin-top: .8rem; color: var(--muted); font-size: .71rem; }
.workflow-rail > span { color: var(--green); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.workflow-rail .link-button { font-size: .72rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kpi { padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .74rem; font-weight: 700; }
.kpi-value { margin: .8rem 0 .25rem; font-size: 2rem; letter-spacing: -.05em; }
.kpi-note { font-size: .74rem; color: var(--muted); }
.kpi-note.good { color: var(--green); }
.section-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; margin-top: 1rem; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-family: Georgia, serif; font-size: 1.1rem; font-weight: 500; }
.panel-body { padding: 1.2rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 38px; gap: .7rem; align-items: center; margin: .9rem 0; font-size: .78rem; }
.bar { height: 8px; border-radius: 5px; background: #edf0e9; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.list { display: grid; gap: .75rem; }
.list-item { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding-bottom: .75rem; border-bottom: 1px solid #edf0e9; }
.list-item:last-child { padding-bottom: 0; border-bottom: 0; }
.list-item strong { display: block; font-size: .85rem; }
.list-item small { color: var(--muted); font-size: .74rem; }
.badge { display: inline-flex; align-items: center; border-radius: 20px; padding: .28rem .55rem; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.badge.green { color: #276445; background: var(--mint); }
.badge.gold { color: #8a6419; background: #f9e9c5; }
.badge.rose { color: #945338; background: var(--rose); }
.badge.blue { color: #3b697e; background: var(--blue); }
.badge.gray { color: #68736e; background: #e8ebe6; }
.notice-banner { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1rem; padding: 1rem; border-radius: 13px; background: #edf6f0; border: 1px solid #d5e9db; }
.notice-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: white; font-weight: 800; }
.notice-banner strong { display: block; margin-bottom: .25rem; font-size: .83rem; }
.notice-banner p { margin: 0; color: #547064; font-size: .76rem; line-height: 1.5; }
.toolbar { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); }
.toolbar input { min-width: min(300px, 100%); }
.school-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.school-card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.school-card:hover { border-color: #accdbb; }
.school-card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.school-card h3 { margin: 0; font-size: .98rem; line-height: 1.3; }
.school-code { margin-top: .3rem; color: var(--muted); font-size: .7rem; letter-spacing: .08em; }
.school-meta { display: grid; gap: .42rem; margin: 1rem 0; padding: .8rem 0; border-top: 1px solid #edf0e9; border-bottom: 1px solid #edf0e9; color: var(--muted); font-size: .75rem; }
.school-meta span { display: flex; justify-content: space-between; gap: .5rem; }
.school-meta b { color: var(--ink); font-weight: 700; }
.wrap-cell { white-space: normal; min-width: 260px; max-width: 380px; line-height: 1.45; }
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.output-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.output-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--green); font-size: 1.25rem; font-weight: 800; }
.output-card h3 { margin: .15rem 0 .4rem; font-family: Georgia, serif; font-size: 1.08rem; font-weight: 500; }
.output-card p { margin: 0 0 .9rem; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.print-school-select { width: min(520px, 100%); padding: .75rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); }
.document-card { display: flex; gap: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.document-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--green); font-size: 1.25rem; font-weight: 800; }
.document-card-main { min-width: 0; flex: 1; }
.document-card h3 { margin: .35rem 0 .45rem; font-family: Georgia, serif; font-size: 1.05rem; font-weight: 500; }
.document-card p { margin: 0 0 .8rem; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.document-meta { display: flex; justify-content: space-between; gap: .7rem; margin-bottom: .85rem; color: var(--muted); font-size: .7rem; }
.document-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-card { padding: 1.2rem; }
.notice-body { font-size: .82rem; line-height: 1.6; margin: .7rem 0; white-space: pre-wrap; }
.notice-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .85rem; color: var(--muted); font-size: .72rem; }
.messaging-layout { display: grid; grid-template-columns: minmax(250px, .36fr) minmax(0, .64fr); gap: 1rem; min-height: 520px; }
.thread-list { overflow: hidden; }
.thread-list .panel-head { padding: .9rem 1rem; }
.thread-item { width: 100%; display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border: 0; border-bottom: 1px solid #edf0e9; color: var(--ink); background: transparent; text-align: left; }
.thread-item:hover, .thread-item.active { background: #edf6f0; }
.thread-icon { flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); font-weight: 800; }
.thread-item strong, .thread-item small { display: block; }
.thread-item strong { font-size: .8rem; }
.thread-item small { margin-top: .25rem; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.message-panel { display: flex; flex-direction: column; overflow: hidden; }
.message-list { flex: 1; display: grid; align-content: start; gap: .75rem; padding: 1.2rem; overflow: auto; background: #fbfcf8; }
.message-bubble { width: min(78%, 560px); padding: .8rem .95rem; border: 1px solid var(--line); border-radius: 13px 13px 13px 4px; background: white; box-shadow: 0 4px 12px rgba(22,52,41,.04); }
.message-bubble.mine { justify-self: end; border-color: #c7e1d0; border-radius: 13px 13px 4px 13px; background: #edf6f0; }
.message-meta { display: flex; justify-content: space-between; gap: .7rem; color: var(--muted); font-size: .68rem; }
.message-meta strong { color: var(--ink); }
.message-bubble p { margin: .45rem 0 0; font-size: .8rem; line-height: 1.5; white-space: pre-wrap; }
.message-compose { display: flex; gap: .7rem; padding: 1rem; border-top: 1px solid var(--line); background: var(--panel); }
.message-compose textarea { flex: 1; min-height: 45px; resize: vertical; }
.message-compose input[type="file"] { max-width: 190px; padding: .55rem; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); background: #fbfcf8; font-size: .7rem; }
.whatsapp-layout { grid-template-columns: minmax(250px, .34fr) minmax(0, .66fr); min-height: 620px; }
.chat-statusbar { display: flex; align-items: center; gap: .55rem; margin: .8rem 0 1rem; padding: .65rem .8rem; border: 1px solid #cfe0d4; border-radius: 10px; color: var(--muted); background: #edf6f0; font-size: .72rem; }
.chat-statusbar strong { color: var(--green-dark); }
.live-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #35a36b; box-shadow: 0 0 0 4px rgba(53,163,107,.13); }
.thread-search { padding: .75rem; border-bottom: 1px solid var(--line); background: #fbfaf5; }
.thread-search input { width: 100%; padding: .62rem .75rem; border: 1px solid var(--line); border-radius: 20px; background: white; font-size: .76rem; }
.thread-avatar { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, #27735a, #1e5947); font-size: .78rem; font-weight: 800; }
.thread-avatar.large { width: 42px; height: 42px; }
.thread-preview { min-width: 0; flex: 1; position: relative; padding-right: 3.2rem; }
.thread-preview strong, .thread-preview small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-preview em { position: absolute; top: 0; right: 0; color: var(--muted); font-size: .61rem; font-style: normal; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: #fbfaf5; }
.chat-head h3 { margin: 0; font-size: .95rem; }
.chat-head p { margin: .2rem 0 0; color: var(--muted); font-size: .68rem; }
.chat-head-actions { display: flex; gap: .4rem; margin-left: auto; }
.chat-call { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #bcd9c6; border-radius: 50%; color: var(--green-dark); background: #edf6f0; cursor: pointer; }
.chat-call.video { color: #315b72; border-color: #bed6e1; background: #eef6fa; }
.chat-call:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(22,52,41,.12); }
.chat-tool { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; border: 1px solid var(--line); border-radius: 50%; color: var(--green-dark); background: #fbfaf5; cursor: pointer; }
.chat-tool input[type="file"] { display: none; }
.chat-tool.recording { color: white; background: #be654b; border-color: #be654b; animation: pulse-recording 1.2s infinite; }
.chat-send { flex: 0 0 auto; border-radius: 20px; }
.typing-indicator { display: inline-flex; align-items: center; gap: .22rem; margin: .1rem 0 .3rem; color: var(--muted); font-size: .68rem; }
.typing-indicator span { width: 5px; height: 5px; border-radius: 50%; background: #7aa58a; }
.shared-file { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .55rem; border-radius: 8px; background: rgba(255,255,255,.65); }
.chat-empty { display: grid; place-items: center; align-content: center; min-height: 420px; text-align: center; }
@keyframes pulse-recording { 50% { box-shadow: 0 0 0 5px rgba(190,101,75,.2); } }
.poll-card { display: grid; gap: .45rem; margin-top: .45rem; }
.poll-card > strong { font-size: .85rem; line-height: 1.4; }
.poll-card > small { color: var(--muted); font-size: .68rem; }
.poll-option { display: flex; justify-content: space-between; gap: .7rem; width: 100%; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; text-align: left; font-size: .75rem; cursor: pointer; }
.poll-option:hover, .poll-option.selected { border-color: #83b795; background: #edf6f0; }
.poll-option b { color: var(--green); }
.live-media-box { display: grid; gap: .65rem; margin-top: 1rem; padding: .8rem; border: 1px solid #cfe0d4; border-radius: 12px; background: #edf6f0; }
.live-media-label { color: var(--green-dark); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.live-media-box video { width: 100%; max-height: 240px; border-radius: 9px; background: #10251f; object-fit: cover; }
.link-button { padding: 0; border: 0; color: var(--green); background: transparent; text-align: left; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.map-panel { overflow: hidden; }
.map-stage { position: relative; width: min(520px, 100%); height: 250px; margin: 0 auto; overflow: hidden; border: 1px solid #cfe0d4; border-radius: 14px; background: linear-gradient(145deg, #e8f2e9, #f8f3e3); }
.map-grid { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(rgba(30,89,71,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(30,89,71,.12) 1px, transparent 1px); background-size: 32px 32px; transform: skewY(-8deg) scale(1.08); }
.map-stage::after { content: ''; position: absolute; inset: 22px 42px; border: 1px dashed rgba(30,89,71,.35); border-radius: 48% 38% 56% 44%; transform: rotate(-13deg); pointer-events: none; }
.map-point { position: absolute; z-index: 2; width: 27px; height: 27px; transform: translate(-50%, -50%); border: 3px solid white; border-radius: 50% 50% 50% 0; color: white; background: var(--green); box-shadow: 0 4px 10px rgba(20,55,40,.25); font-size: .62rem; font-weight: 800; cursor: pointer; }
.map-point.risk { background: #be654b; }
.map-point:hover { z-index: 3; transform: translate(-50%, -50%) scale(1.12); }
.map-label { position: absolute; z-index: 1; color: #688073; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.map-label.north { top: 9px; left: 50%; transform: translateX(-50%); }
.map-label.south { bottom: 9px; left: 50%; transform: translateX(-50%); }
.map-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: .8rem 1.3rem; margin-top: .8rem; color: var(--muted); font-size: .7rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.map-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--green); }
.map-dot.risk { background: #be654b; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: .8rem 1rem; border-bottom: 1px solid #edf0e9; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; background: #fbfaf5; }
td strong { font-size: .8rem; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: .35rem; }
.sync-board { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; }
.sync-status { padding: 1.3rem; border-radius: 14px; color: white; background: var(--green-dark); }
.sync-status .big { margin: 1rem 0; font-family: Georgia, serif; font-size: 2.4rem; }
.sync-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.sync-stat { padding: .8rem; border-radius: 10px; background: rgba(255,255,255,.09); }
.sync-stat span { display: block; color: #95b1a4; font-size: .68rem; }
.sync-stat b { display: block; margin-top: .25rem; font-size: 1.2rem; }
.timeline { display: grid; gap: 1rem; }
.timeline-item { display: grid; grid-template-columns: 12px 1fr; gap: .75rem; }
.timeline-dot { width: 10px; height: 10px; margin-top: .25rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px #f8ecd2; }
.timeline-item strong { font-size: .8rem; }
.timeline-item p { margin: .2rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 1rem; background: rgba(16,37,31,.54); }
.modal { width: min(660px, 100%); max-height: min(720px, 92vh); overflow: auto; border-radius: 16px; background: var(--panel); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.close { width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: #eef0e9; font-size: 1.2rem; }
.modal-body { padding: 1.4rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.3rem; }
.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: grid; gap: .6rem; }
.toast { max-width: 340px; padding: .8rem 1rem; border: 1px solid #cfe0d4; border-radius: 10px; color: #254d3e; background: #eff8f0; box-shadow: var(--shadow); font-size: .78rem; }
.footer-note { margin-top: 1.3rem; color: var(--muted); font-size: .72rem; }
.workflow-records { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; color: var(--muted); font-size: .68rem; }
.workflow-records > span { margin-right: .15rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.workflow-records > span b { display: inline-grid; min-width: 1.25rem; height: 1.25rem; place-items: center; margin-left: .25rem; border-radius: 999px; color: white; background: var(--green); font-size: .64rem; }
.record-chip { max-width: 180px; overflow: hidden; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--green-dark); background: #f4f8f1; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.record-chip:hover { border-color: #83b795; background: #eaf4eb; }
.context-note { padding: .65rem .8rem; border: 1px solid #c9dfcf; border-radius: 9px; color: var(--green-dark); background: #eef8ef; font-size: .72rem; line-height: 1.45; }
.conditional-field.is-hidden { display: none; }
.record-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.record-field { min-width: 0; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: #fbfcf8; }
.record-field span, .record-field strong { display: block; }
.record-field span { margin-bottom: .2rem; color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; }
.record-field strong { overflow-wrap: anywhere; color: var(--ink); font-size: .75rem; line-height: 1.35; }
.alert-item { width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .8rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--panel); text-align: left; cursor: pointer; }
.alert-item + .alert-item { margin-top: .55rem; }
.alert-item:hover { border-color: #9fc4ad; background: #f8fbf7; }
.alert-symbol { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--green); font-weight: 800; }
.alert-item.gold .alert-symbol { background: #b48632; }
.alert-item.rose .alert-symbol { background: #be654b; }
.alert-item strong, .alert-item small { display: block; }
.alert-item strong { font-size: .78rem; }
.alert-item small { margin-top: .2rem; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.guide-card { display: flex; gap: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: 11px; background: #fbfcf8; }
.guide-icon { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--green); font-weight: 800; }
.guide-card h3 { margin: .05rem 0 .25rem; font-family: Georgia, serif; font-size: .88rem; font-weight: 500; }
.guide-card p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }

@media (max-width: 1100px) { .school-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) { .login-shell { grid-template-columns: 1fr; } .login-pane-card { min-height: auto; } .login-story { min-height: 70vh; padding: 1.2rem; } .login-story h1 { font-size: 3.6rem; } .login-story .story-foot { margin-top: 2rem; } .app-shell { display: block; } .sidebar { position: sticky; top: 0; z-index: 20; padding: .8rem 1rem; display: block; } .sidebar .brand { margin-bottom: .75rem; } .nav-caption { display: none; } .nav { display: flex; overflow-x: auto; gap: .3rem; } .nav-label, .sidebar-bottom { display: none; } .menu-group-button { flex: 0 0 auto; width: auto; min-width: 155px; } .nav-group-items { flex: 0 0 auto; display: flex; margin: 0; padding: 0; border-left: 0; gap: .2rem; } .return-menu-groups { margin-top: 0; border-top: 0 !important; padding-top: .58rem !important; } .nav button { white-space: nowrap; padding: .58rem .7rem; } .section-grid, .sync-board, .messaging-layout { grid-template-columns: 1fr; } .topbar { position: static; } .document-grid, .output-grid { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .content { padding: 1rem; } .page-intro { display: block; } .page-intro .actions { margin-top: 1rem; } .school-grid, .kpi-grid { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .form-grid .full { grid-column: auto; } .record-detail-grid { grid-template-columns: 1fr; } .connection span { display: none; } .license-chip small { display: none; } .license-chip { padding: .35rem; } .guide-grid { grid-template-columns: 1fr; } .message-compose { display: grid; } .message-bubble { width: 90%; } }

.population-block { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; margin:0 0 1rem; padding:1rem; border:1px solid var(--line); border-radius:12px; background:#fbfaf5; }
.population-block legend { padding:0 .45rem; color:var(--green); font-weight:800; }
.population-block .field { margin-bottom:0; }
.child-row { display:grid; grid-template-columns:1.4fr 1fr .5fr .8fr 1.2fr auto; gap:.6rem; align-items:end; padding:.75rem 0; border-bottom:1px solid var(--line); }
.child-row .field { margin:0; }
.school-logo-preview,.school-profile-logo { width:84px; height:84px; object-fit:contain; border:1px solid var(--line); border-radius:12px; background:white; padding:.25rem; }
.google-signin { width:100%; margin-top:.75rem; color:#25303b; background:white; border:1px solid #cbd3da; }
.principal-grants { margin-top:1rem; }
@media (max-width:800px) {
  .sidebar { position:fixed; inset:0 auto 0 0; width:min(86vw,300px); transform:translateX(0); transition:transform .2s ease; overflow-y:auto; z-index:40; }
  .app-shell.sidebar-collapsed .sidebar { transform:none; width:0; min-width:0; padding:0; overflow:visible; }
  .app-shell,.app-shell.sidebar-collapsed { display:block; }
  .sidebar-toggle { top:68px; left:min(258px,calc(86vw - 19px)); transform:none; }
  .app-shell.sidebar-collapsed .sidebar-toggle { left:12px; }
  .nav { display:grid; overflow:visible; }
  .menu-group-button,.nav-group-items { width:100%; display:grid; }
  .nav-group-items { gap:.3rem; }
  .nav-label,.sidebar-bottom { display:block; }
  .population-block { grid-template-columns:1fr 1fr; }
  .child-row { grid-template-columns:1fr 1fr; padding:1rem 0; }
  .child-remove { grid-column:1/-1; }
  .modal { width:min(96vw,760px); max-height:94vh; }
  .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
@media (max-width:520px) { .population-block,.child-row { grid-template-columns:1fr; } .top-actions { gap:.3rem; } }
