:root {
  --bg: #eef1ed;
  --bg-accent: #e4ebe6;
  --card: rgba(255, 255, 255, 0.94);
  --card-strong: #ffffff;
  --card-subtle: #f5f5f1;
  --text: #182126;
  --muted: #5a6670;
  --muted-strong: #44515b;
  --border: rgba(24, 33, 38, 0.12);
  --border-strong: rgba(24, 33, 38, 0.18);
  --accent: #226c67;
  --accent-strong: #194f4c;
  --accent-soft: rgba(34, 108, 103, 0.10);
  --accent-soft-strong: rgba(34, 108, 103, 0.18);
  --danger: #c24141;
  --ok: #1f8f58;
  --late: #6f56cf;
  --focus: rgba(34, 108, 103, 0.18);
  --shadow: 0 8px 24px rgba(24, 33, 38, 0.08);
  --shadow-strong: 0 14px 30px rgba(24, 33, 38, 0.10);
  --radius: 16px;
  --radius-sm: 12px;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.45;
  background:
    radial-gradient(circle at top left, rgba(34, 108, 103, 0.08), rgba(34, 108, 103, 0) 32%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 240px, var(--bg) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 2px;
}
.wrap { max-width: 1360px; margin: 0 auto; padding: 22px 22px 40px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 12px 0; font-weight: 700; letter-spacing: -0.01em; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(29, 55, 54, 0.94);
  color: #ffffff;
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  z-index: 20;
  box-shadow: 0 10px 28px rgba(24, 33, 38, 0.18);
}
.topbarLeft, .topbarRight { display: flex; align-items: center; gap: 10px; }
.topbarCenter { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; }
@media (min-width: 901px) { #sidebarToggle { display: none; } }
.profileWidget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  max-width: 560px;
  width: 100%;
}
.search input {
  border: 0;
  background: transparent;
  padding: 0;
  height: 22px;
  color: #ffffff;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.72); }
.search input:focus { outline: none; }
.who {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#profileWidget .who {
  border: 0;
  background: transparent;
  padding: 0;
}
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.tab.active {
  border-color: rgba(34, 108, 103, 0.30);
  background: var(--accent-soft);
}
.muted { color: var(--muted); }
.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.btn:hover {
  background: var(--card-strong);
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgba(24, 33, 38, 0.08);
}
.btn:active { transform: translateY(1px); }
.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}
.btn.iconBtn { padding: 8px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; min-width: 42px; }
.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
}
.btn.primary:hover {
  background: var(--accent-strong);
  border-color: transparent;
}
.btn.action {
  border-color: rgba(34, 108, 103, 0.24);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.btn.action:hover {
  background: var(--accent-soft-strong);
}
.btn.danger {
  border-color: transparent;
  background: rgba(194, 65, 65, 0.12);
  color: #7f1d1d;
}
.btn.ok {
  border-color: transparent;
  background: rgba(31, 143, 88, 0.12);
  color: #14532d;
}
.btn.late {
  border-color: transparent;
  background: rgba(124, 58, 237, 0.12);
  color: #4c1d95;
}
.topbar .btn {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}
.topbar .btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.26);
}
input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(34, 108, 103, 0.34);
  box-shadow: 0 0 0 4px var(--focus);
}
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
}
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
tbody tr:hover { background: rgba(255, 255, 255, 0.58); }
tbody tr:last-child td { border-bottom: none; }
td[colspan] { padding-top: 18px; padding-bottom: 18px; }
.tableStatusCell {
  padding: 18px 14px;
  text-align: center;
}
.tableStatusCell .status,
.tableStatusCell .muted.small {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
}
.tableStatusCell .status.bad {
  border-color: rgba(194, 65, 65, 0.22);
  background: rgba(194, 65, 65, 0.08);
}
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.88);
}
.status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--muted-strong);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 180ms ease, transform 180ms ease, color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.status:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(24, 33, 38, 0.06);
}
.status.ok { color: var(--ok); }
.status.bad { color: var(--danger); }
.status.loading {
  color: var(--accent-strong);
}
.status.loading::before {
  animation: loadingPulse 900ms ease-in-out infinite;
}
.status.success {
  color: var(--ok);
}
.status.error {
  color: var(--danger);
}
.status.info {
  color: var(--muted-strong);
}
.status.quiet {
  color: var(--muted);
}
.status:empty::before {
  display: none;
}
.toolbarSplit .status,
.row .status {
  flex: 1 1 220px;
}
.btn.is-busy,
.btn.is-success {
  position: relative;
}
.btn.is-busy {
  border-color: rgba(34, 108, 103, 0.28);
  box-shadow: 0 0 0 4px rgba(34, 108, 103, 0.10);
}
.btn.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: buttonSpin 720ms linear infinite;
  vertical-align: -2px;
}
.btn.is-success {
  box-shadow: 0 0 0 4px rgba(31, 143, 88, 0.12);
}
.btn.is-success::after {
  content: "✓";
  margin-left: 8px;
  font-weight: 900;
}
.panelSavedFlash {
  animation: panelSavedFlash 1000ms ease;
}
.hidden { display: none; }
.modalRoot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(6px);
}
.modalDialog {
  position: relative;
  width: min(980px, 100%);
  max-height: min(86vh, 860px);
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(24, 33, 38, 0.20);
  display: flex;
  flex-direction: column;
}
.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(245, 245, 241, 0.92), rgba(255, 255, 255, 0.94));
  position: sticky;
  top: 0;
  z-index: 1;
}
.modalTitle { font-weight: 800; }
.modalBody {
  padding: 18px;
  overflow: auto;
  background: rgba(245, 245, 241, 0.72);
}
.modalBody > *:first-child { margin-top: 0; }
.modalBody > *:last-child { margin-bottom: 0; }
.modalBody .card {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.84);
}
.modalBody .grid2,
.modalBody .row + .row,
.modalBody label + input,
.modalBody label + select,
.modalBody label + textarea {
  margin-top: 10px;
}
.modalBody .formSection {
  background: rgba(255, 255, 255, 0.88);
}
.attKidsGrid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.attKidBtn { padding: 10px 12px; border-radius: 999px; }
.attKidBtn[disabled] { opacity: 0.6; cursor: not-allowed; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.small { font-size: 12px; }
.pageHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pageHeaderTight { margin-bottom: 0; }
.homeHero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}
.homeHeroMain {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.homeHeroNote,
.homeQuickPanel,
.moduleBanner,
.cardSubtle {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}
.homeHeroNote {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 245, 241, 0.92));
}
.homeHeroTitle,
.homeQuickPanelTitle,
.moduleBannerTitle,
.panelLabelTitle,
.reportFormIntroTitle {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.homeQuickPanel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(245, 245, 241, 0.82);
}
.quickLinksStack {
  margin-top: 0;
  flex-direction: column;
}
.quickLinksStack .btn {
  justify-content: flex-start;
  width: 100%;
}
.sectionBlock {
  margin-top: 18px;
}
.sectionBlockHead,
.panelLabelRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.moduleBanner {
  margin-top: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background: linear-gradient(180deg, rgba(245, 245, 241, 0.8), rgba(255, 255, 255, 0.78));
}
.moduleBannerChips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.threadHintBar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}
.listEmptyState,
.tableEmptyState {
  padding: 18px 14px;
}
.loadingState {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loadingStateTitle {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.loadingDots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.loadingDots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(34, 108, 103, 0.32);
  animation: loadingPulse 900ms ease-in-out infinite;
}
.loadingDots span:nth-child(2) { animation-delay: 120ms; }
.loadingDots span:nth-child(3) { animation-delay: 240ms; }
.listEmptyTitle,
.tableEmptyTitle,
.threadEmptyTitle {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.threadEmptyState {
  margin: auto 0;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 520px;
}
.threadEmptyIcon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
}
.threadEmptyText {
  color: var(--muted-strong);
  max-width: 54ch;
}
.threadEmptyChips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbarSplit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.cardSubtle {
  background: rgba(245, 245, 241, 0.72);
  box-shadow: none;
}
.reportFormIntro {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(245, 245, 241, 0.76);
}
.moduleGrid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: start;
}
.formStack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.helperStrip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.formSection {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
}
.formSectionTitle {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modalFormCard {
  max-width: 860px;
  width: 100%;
}
.modalFormCard h3 {
  margin: 0;
}
.emergencyGrid {
  gap: 8px;
}
.calendarPanel {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.calendarWrap {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
}
.eventsCalGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.eventsCalWeekday {
  text-align: center;
  font-weight: 700;
}
.eventsCalCell {
  min-height: 104px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eventsCalCell.isAlert {
  border-color: rgba(194, 65, 65, 0.18);
  background: rgba(194, 65, 65, 0.06);
}
.eventsCalCell.isEmpty {
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.eventsCalDay {
  font-weight: 800;
}
.eventsCalCell.isAlert .eventsCalDay {
  color: #a02323;
}
.eventsCalHoliday {
  color: #a02323;
  font-size: 12px;
  font-weight: 600;
}
.eventsCalTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.eventsCalTag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(31, 143, 88, 0.22);
  background: rgba(31, 143, 88, 0.09);
  color: #14613e;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eventsCalTag.isHoliday {
  border-color: rgba(194, 65, 65, 0.22);
  background: rgba(194, 65, 65, 0.10);
  color: #a02323;
}

#messages:not(.hidden) {
  height: var(--panelH, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#messages:not(.hidden) .messagesLayout { flex: 1 1 auto; min-height: 0; }
#messages:not(.hidden) .messagesLeft,
#messages:not(.hidden) .messagesRight { min-height: 0; }

.messagesLayout { display: grid; grid-template-columns: 360px 1fr; gap: 12px; margin-top: 12px; min-height: 560px; }
.messagesLeft, .messagesRight {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.90);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.messagesLeft { display: flex; flex-direction: column; min-width: 0; }
.messagesLeftTop { padding: 14px; border-bottom: 1px solid var(--border); background: rgba(245, 245, 241, 0.58); }
.messagesTabs { display: flex; gap: 8px; }
.chipBtn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chipBtn.active { border-color: rgba(34, 108, 103, 0.28); background: var(--accent-soft); color: var(--text); }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(34, 108, 103, 0.24);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.conversationList { overflow: auto; flex: 1 1 auto; }
.conversationItem {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.conversationItem:hover { background: rgba(255, 255, 255, 0.72); }
.conversationItem.active { background: var(--accent-soft); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(243, 244, 246, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--accent);
  flex: 0 0 auto;
  overflow: hidden;
}
.conversationMain { flex: 1 1 auto; min-width: 0; }
.conversationTitle { font-weight: 750; }
.conversationSnippet { margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messagesRight { display: flex; flex-direction: column; min-width: 0; }
.threadHeader { padding: 14px; border-bottom: 1px solid var(--border); background: rgba(245, 245, 241, 0.58); }
.threadTitle { font-weight: 800; }
.threadSub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.threadNewBanner {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(245, 245, 241, 0.76);
  display: none;
  justify-content: center;
}
.threadNewBanner:not(.hidden) { display: flex; }
.threadNewBanner .btn { width: auto; }
.threadBody { padding: 14px; overflow: auto; flex: 1 1 auto; background: rgba(245, 245, 241, 0.56); display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 760px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  align-self: flex-start;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.bubble.me { margin-left: auto; align-self: flex-end; border-color: rgba(34, 108, 103, 0.32); background: var(--accent-soft); }
.bubble.deleted { opacity: 0.72; border-style: dashed; }
.bubbleAttachments { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.bubbleAttachments > * { max-width: 100%; }
.msgAttLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(243, 244, 246, 0.85);
  text-decoration: none;
  color: var(--text);
  max-width: 100%;
}
.msgAttLink:hover { border-color: rgba(34, 108, 103, 0.28); background: var(--accent-soft); }
.msgAttIcon { width: 18px; height: 18px; flex: 0 0 auto; color: rgba(20, 33, 61, 0.78); }
.msgAttIcon.pdf { color: rgba(185, 28, 28, 0.95); }
.msgAttIcon.word { color: rgba(29, 78, 216, 0.95); }
.msgAttIcon.excel { color: rgba(21, 128, 61, 0.95); }
.msgAttName { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.composerFilesPreview { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 12px 0; }
.composerFileCard {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.88);
}
.composerFileThumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(20,33,61,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.composerFileThumb img,
.composerFileThumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.composerFileMeta { min-width: 0; flex: 1; }
.composerFileName { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composerFileSub { font-size: 11px; color: var(--muted); }
.composerFileRemove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.96);
  cursor: pointer;
}
.waLightboxMedia { max-width: min(92vw, 920px); max-height: 72vh; display: block; margin: 0 auto; border-radius: 16px; background: #000; }
.waLightboxCaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--muted); }
.bubbleDeleted { margin-top: 8px; font-size: 12px; color: var(--muted); }
.bubbleMeta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.bubbleMetaRow { margin-top: 6px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.ticks { font-weight: 900; letter-spacing: -1px; }
.ticks.gray { color: rgba(20, 33, 61, 0.45); }
.ticks.blue { color: var(--accent); }
.bubbleActions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.bubbleBtn { padding: 8px 10px; border-radius: 12px; font-size: 12px; }
.bubbleResponse { margin-top: 8px; font-size: 12px; color: var(--muted); }
.composer { padding: 14px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; position: relative; background: rgba(255, 255, 255, 0.72); }
.composer textarea { min-height: 44px; max-height: 180px; }
.composer .clipBtn { flex: 0 0 auto; }
.fileRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.75);
  margin-top: 8px;
}
.fileRow .btn { padding: 6px 8px; border-radius: 10px; }
@media (max-width: 900px) {
  .moduleGrid { grid-template-columns: 1fr; }
  .eventsCalGrid { gap: 6px; }
  .messagesLayout { grid-template-columns: 1fr; }
  .messagesLeft { max-height: 320px; }
  .messagesRight { min-height: 520px; }
  .reportLayout { grid-template-columns: 1fr; min-height: auto; }
  .reportLeft { max-height: 320px; }
}
.reportLayout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 12px;
  margin-top: 12px;
  min-height: 560px;
}
.reportLeft, .reportRight {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.90);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.reportLeft { display: flex; flex-direction: column; min-width: 0; }
.reportLeftTop { padding: 14px; border-bottom: 1px solid var(--border); background: rgba(245, 245, 241, 0.58); }
.reportBulkToolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.reportChildList {
  overflow: auto;
  flex: 1 1 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(245, 245, 241, 0.32);
}
.reportChildCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.reportChildCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(24, 33, 38, 0.08);
}
.reportChildCard.is-active {
  border-color: rgba(34, 108, 103, 0.34);
  box-shadow: 0 0 0 4px var(--focus);
}
.reportChildCard.is-selected {
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}
.reportChildCard.state-missing {
  border-color: rgba(194, 65, 65, 0.24);
  background: rgba(194, 65, 65, 0.07);
}
.reportChildCard.state-draft {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(245, 158, 11, 0.10);
}
.reportChildCard.state-published {
  border-color: rgba(31, 143, 88, 0.26);
  background: rgba(31, 143, 88, 0.09);
}
.reportChildCardBody {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.reportChildCardName {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.reportChildCardMeta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-strong);
}
.reportChildCardAside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.reportChildCardSelect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-strong);
  cursor: pointer;
}
.reportChildCardSelect.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
}
.reportChildCardCheckbox {
  width: 16px;
  height: 16px;
  margin: 0;
}
.reportRight { display: flex; flex-direction: column; min-width: 0; }
.reportHeader { padding: 14px; border-bottom: 1px solid var(--border); background: rgba(245, 245, 241, 0.58); }
.reportHeaderTitle { font-weight: 800; }
.reportHeaderSub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.reportBody { padding: 14px; overflow: auto; flex: 1 1 auto; }
.segRow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.segBtn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  min-width: 120px;
  text-align: center;
  font-weight: 700;
}
.segBtn.active { border-color: rgba(31, 143, 88, 0.28); background: rgba(31, 143, 88, 0.10); }
.segBtn.mutedActive { border-color: rgba(34, 108, 103, 0.28); background: var(--accent-soft); }
.checkRow { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.checkRow label { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-size: 13px; color: var(--text); }
.moodGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.moodBtn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  min-height: 52px;
}
.moodBtn:hover { background: rgba(255, 255, 255, 0.98); }
.moodBtn.selected { border-color: rgba(31, 143, 88, 0.28); background: rgba(31, 143, 88, 0.10); }
.moodEmoji { font-size: 22px; filter: grayscale(1); opacity: 0.55; transition: filter 120ms ease, opacity 120ms ease; }
.moodBtn.selected .moodEmoji { filter: none; opacity: 1; }
.moodLabel { font-weight: 750; font-size: 13px; line-height: 1.15; }
@media (max-width: 520px) {
  .moodGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mini { font-size: 12px; color: var(--muted); }
.attachmentsRow { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attLink { font-size: 12px; color: var(--accent); text-decoration: underline; word-break: break-all; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 241, 0.86));
  box-shadow: var(--shadow);
}
.kpiLabel { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.kpiValue { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.kpiSub { margin-top: 4px; }
.quickLinks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.quickLinks .btn { border-radius: 999px; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
}
.content { min-width: 0; }
.sidebar {
  background: rgba(245, 245, 241, 0.84);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow: auto;
}
.sidebarBrand {
  padding: 12px 12px 14px;
  border-bottom: 1px solid rgba(24, 33, 38, 0.08);
  margin-bottom: 12px;
}
.sidebarBrandTitle {
  font-weight: 800;
  letter-spacing: 0.01em;
}
.sidebarBrandSubtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebarTitle {
  font-weight: 750;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menuItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}
.menuItem:hover {
  border-color: rgba(34, 108, 103, 0.24);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(24, 33, 38, 0.08);
}
.menuItem.active {
  border-color: rgba(34, 108, 103, 0.26);
  background: var(--accent-soft);
}
.menuIcon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
}
.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}
.menuLabel { white-space: nowrap; }

body.sidebar-collapsed .layout { grid-template-columns: 76px 1fr; }
body.sidebar-collapsed .menuLabel { display: none; }
body.sidebar-collapsed .sidebar { padding: 10px 8px; }
body.sidebar-collapsed .menuItem { justify-content: center; padding: 10px 8px; }
body.sidebar-collapsed .sidebarTitle { display: none; }
body.sidebar-collapsed .sidebarBrandSubtitle { display: none; }

.sidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  z-index: 30;
}

@media (max-width: 900px) {
  .wrap { padding: 12px 12px 24px; }
  .topbar { padding: 10px 12px; }
  .topbarCenter { justify-content: stretch; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .homeHero { grid-template-columns: 1fr; }
  .moduleGrid { grid-template-columns: 1fr; }
  .moduleBanner,
  .toolbarSplit,
  .sectionBlockHead,
  .panelLabelRow { flex-direction: column; align-items: flex-start; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    height: 100vh;
    max-height: none;
    width: 270px;
    z-index: 40;
    transition: left 180ms ease;
  }
  body.sidebar-open .sidebar { left: 12px; }
  body.sidebar-collapsed .layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .topbarCenter { order: 3; width: 100%; }
  .topbarRight { width: 100%; justify-content: flex-end; }
  .kpis { grid-template-columns: 1fr; }
  .moduleBanner { padding: 12px; }
  .threadHintBar { padding: 10px 12px; }
  .formSection,
  .calendarWrap { padding: 12px; }
  .eventsCalGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eventsCalWeekday { display: none; }
  .eventsCalCell { min-height: 92px; }
  .messagesLeft { max-height: 280px; }
  .messagesRight { min-height: 460px; }
  .reportLeft { max-height: 280px; }
  .reportBulkToolbar { flex-direction: column; align-items: stretch; }
  .reportChildCard {
    grid-template-columns: 1fr;
  }
  .reportChildCardAside {
    align-items: flex-start;
  }
  .bubble,
  .bubble.me { max-width: 100%; }
}

@keyframes loadingPulse {
  0%, 80%, 100% { opacity: 0.32; transform: scale(0.9); }
  40% { opacity: 1; transform: scale(1); }
}

@keyframes buttonSpin {
  to { transform: rotate(360deg); }
}

@keyframes panelSavedFlash {
  0% { box-shadow: 0 0 0 0 rgba(31, 143, 88, 0.18); }
  40% { box-shadow: 0 0 0 6px rgba(31, 143, 88, 0.12); }
  100% { box-shadow: 0 0 0 0 rgba(31, 143, 88, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .status,
  .btn,
  .panelSavedFlash {
    transition: none;
    animation: none !important;
  }
  .btn.is-busy::after {
    animation: none;
  }
}

.loginHero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.loginMark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
}
.loginMark .icon { width: 22px; height: 22px; }
.inputGroup {
  position: relative;
  width: 100%;
}
.inputRightBtn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 7px 10px;
  border-radius: 10px;
}
.inputHasRightBtn input {
  padding-right: 64px;
}

.btn:focus-visible,
.tab:focus-visible,
.chipBtn:focus-visible,
.menuItem:focus-visible,
.conversationItem:focus-visible,
.segBtn:focus-visible,
.moodBtn:focus-visible {
  outline: none;
  border-color: rgba(34, 108, 103, 0.34);
  box-shadow: 0 0 0 4px var(--focus);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
