:root {
  --bg0: #ffe9f4;
  --bg1: #e6f8ff;
  --text: #14213d;
  --muted: #51607a;
  --border: rgba(20, 33, 61, 0.14);
  --shadow: 0 18px 55px rgba(20, 33, 61, 0.16);
  --shadowSoft: 0 10px 26px rgba(20, 33, 61, 0.12);
  --accent: #1f6fff;
  --accent2: #6d28ff;
  --danger: #ff2d55;
  --ok: #00c48c;
  --warn: #ffb020;
  --pink: #ff2d8d;
  --sky: #1f6fff;
  --mint: #00c48c;
  --sun: #ffb020;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: #f6f7fb;
  color: var(--text);
}
a { color: var(--accent); }
.wrap { max-width: 1400px; margin: 0 auto; padding: 16px; }
.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadowSoft);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(90deg, var(--pink) 0%, var(--accent2) 45%, var(--accent) 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  z-index: 10;
  box-shadow: 0 14px 38px rgba(20, 33, 61, 0.18);
}
.topbar .muted { color: rgba(255, 255, 255, 0.85); }
.topbar .btn {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.topbar .btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.topbar #sidebarToggle {
  display: none;
}
@media (max-width: 900px) {
  .topbar #sidebarToggle {
    display: inline-flex;
  }
}
.topbar #childSelect {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.profileWidget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.profileName {
  font-size: 12px;
  color: #ffffff;
  font-weight: 850;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand {
  font-weight: 900;
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, var(--pink), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.06);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(20, 33, 61, 0.12); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #ffffff;
}
.btn.danger { border-color: transparent; background: rgba(255, 45, 85, 0.16); color: #7f1d1d; }
.btn.ok { border-color: transparent; background: rgba(0, 196, 140, 0.16); color: #14532d; }
.btn.warn { border-color: transparent; background: rgba(255, 176, 32, 0.18); color: #7a4b00; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
textarea { min-height: 110px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab {
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.06);
}
.tab.active {
  border-color: rgba(31, 111, 255, 0.55);
  background: linear-gradient(90deg, rgba(31, 111, 255, 0.26), rgba(109, 40, 255, 0.22), rgba(255, 45, 141, 0.20));
}
.hidden { display: none; }
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  color: rgba(20, 33, 61, 0.72);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.65);
}
.pill.attOk {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.16);
  color: rgba(21, 128, 61, 0.95);
  font-weight: 800;
}
.pill.attBad {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.14);
  color: rgba(185, 28, 28, 0.95);
  font-weight: 800;
}
.status { font-size: 12px; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--danger); }
.tile {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadowSoft);
}
.tile h3 { margin: 0 0 6px 0; font-size: 14px; }
.tile .big { font-size: 22px; font-weight: 800; }
table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 10px; }
th, td { padding: 10px; border-bottom: 1px solid rgba(20, 33, 61, 0.10); vertical-align: top; }
th { text-align: left; color: var(--muted); font-weight: 650; font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.empty { padding: 14px; color: var(--muted); }
.kpiRow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .kpiRow { grid-template-columns: 1fr; } }
.kpiRow .tile { position: relative; overflow: hidden; }
.kpiTile { cursor: pointer; }
.kpiTile:hover { border-color: rgba(31, 111, 255, 0.32); }
.kpiRow .tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 220px at 20% 20%, rgba(31, 111, 255, 0.26), rgba(31, 111, 255, 0) 62%);
  pointer-events: none;
}
.kpiRow .tile:nth-child(1)::before {
  background: radial-gradient(500px 220px at 20% 20%, rgba(255, 45, 141, 0.26), rgba(255, 45, 141, 0) 62%);
}
.kpiRow .tile:nth-child(2)::before {
  background: radial-gradient(500px 220px at 20% 20%, rgba(255, 176, 32, 0.28), rgba(255, 176, 32, 0) 62%);
}
.kpiRow .tile:nth-child(3)::before {
  background: radial-gradient(500px 220px at 20% 20%, rgba(0, 196, 140, 0.24), rgba(0, 196, 140, 0) 62%);
}
@media (max-width: 900px) {
  .kpiRow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
  }
  .kpiRow .tile {
    padding: 8px 9px;
    border-radius: 14px;
    min-height: 72px;
  }
  .kpiRow .tile h3 {
    margin: 0 0 4px 0;
    font-size: 12px;
    line-height: 1.15;
  }
  .kpiRow .tile .big {
    font-size: 30px;
    line-height: 1;
  }
  .kpiRow .tile .muted.small {
    display: none;
  }
  body[data-tab="messages"] .kpiRow {
    display: none;
  }
  body[data-tab="messages"] #messages:not(.hidden) {
    height: max(var(--panelH, 85dvh), 85dvh);
  }
  body[data-tab="messages"] #messages > .row .muted.small {
    display: none;
  }
  body[data-tab="messages"] #messages > .row .pill {
    display: none;
  }
  body[data-tab="messages"] #messages > .row .btn {
    padding: 8px 10px;
    border-radius: 12px;
  }
  body[data-tab="messages"] #messages:not(.hidden) .messagesLayout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  body[data-tab="messages"] #messages:not(.hidden) .messagesLeft {
    flex: 0 0 auto;
    max-height: 18dvh;
  }
  body[data-tab="messages"] #messages:not(.hidden) .messagesRight {
    flex: 1 1 auto;
    min-height: 0;
  }
  body[data-tab="messages"] .threadHeader,
  body[data-tab="messages"] .threadNewBanner,
  body[data-tab="messages"] .composer {
    padding: 10px;
  }
}
@media (max-width: 430px) {
  body[data-tab="messages"] .kpiRow {
    display: none;
  }
  .wrap {
    padding: 10px;
  }
  .topbar {
    padding: 8px 10px;
    gap: 8px;
  }
  #subtitle {
    display: none;
  }
  .profileWidget {
    padding: 4px 8px;
    gap: 8px;
  }
  .profileName {
    max-width: 130px;
  }
  #profilePhotoBtn,
  #editChildBtn {
    display: none;
  }
  .topbar .row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar .row::-webkit-scrollbar {
    display: none;
  }
  .topbar .btn {
    padding: 8px 10px;
    border-radius: 12px;
  }
  .topbar #childSelect {
    min-width: 170px;
    padding: 10px;
  }
  .messagesLeft {
    max-height: 16dvh;
  }
  .kpiRow {
    gap: 6px;
  }
  .kpiRow .tile {
    padding: 7px 8px;
    min-height: 66px;
  }
  .kpiRow .tile h3 {
    font-size: 11px;
  }
  .kpiRow .tile .big {
    font-size: 26px;
  }
}
@media (max-width: 375px) {
  body[data-tab="messages"] .kpiRow {
    display: none;
  }
  .wrap {
    padding: 8px;
  }
  .topbar {
    padding: 7px 8px;
  }
  .profileName {
    max-width: 110px;
  }
  .topbar .btn {
    padding: 7px 9px;
  }
  .topbar #childSelect {
    min-width: 150px;
    padding: 9px;
  }
  .messagesLeft {
    max-height: 15dvh;
  }
  .kpiRow .tile {
    padding: 6px 7px;
    min-height: 62px;
  }
  .kpiRow .tile h3 {
    font-size: 10px;
  }
  .kpiRow .tile .big {
    font-size: 24px;
  }
}

#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 rgba(20, 33, 61, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadowSoft);
  overflow: hidden;
}
.messagesLeft { display: flex; flex-direction: column; min-width: 0; }
.messagesLeftTop { padding: 12px; border-bottom: 1px solid rgba(20, 33, 61, 0.10); }
.messagesTabs { display: flex; gap: 8px; flex-wrap: wrap; }
.chipBtn {
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chipBtn.active {
  border-color: rgba(31, 111, 255, 0.55);
  background: linear-gradient(90deg, rgba(31, 111, 255, 0.26), rgba(109, 40, 255, 0.22), rgba(255, 45, 141, 0.20));
}
.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(31, 111, 255, 0.45);
  background: rgba(31, 111, 255, 0.18);
  color: rgba(20, 33, 61, 0.82);
  font-size: 12px;
  font-weight: 800;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
}
.search input {
  border: 0;
  background: transparent;
  padding: 0;
}
.search input:focus { outline: none; }
.conversationList { overflow: auto; flex: 1 1 auto; }
.conversationItem {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.10);
  cursor: pointer;
}
.conversationItem:hover { background: rgba(255, 255, 255, 0.9); }
.conversationItem.active { background: rgba(31, 111, 255, 0.16); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: rgba(20, 33, 61, 0.82);
  flex: 0 0 auto;
  overflow: hidden;
}
.conversationMain { flex: 1 1 auto; min-width: 0; }
.conversationTitle { font-weight: 900; }
.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: 12px; border-bottom: 1px solid rgba(20, 33, 61, 0.10); }
.threadTitle { font-weight: 950; }
.threadSub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.threadNewBanner {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.10);
  background: rgba(255, 255, 255, 0.82);
  display: none;
  justify-content: center;
}
.threadNewBanner:not(.hidden) { display: flex; }
.threadNewBanner .btn { width: auto; }
.threadBody { padding: 12px; overflow: auto; flex: 1 1 auto; background: rgba(255, 255, 255, 0.55); display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 760px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: rgba(255, 255, 255, 0.86);
}
.bubble.me { margin-left: auto; border-color: rgba(47, 122, 248, 0.35); background: rgba(47, 122, 248, 0.10); }
.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 rgba(20, 33, 61, 0.12);
  background: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  color: rgba(20, 33, 61, 0.92);
  max-width: 100%;
}
.msgAttLink:hover { border-color: rgba(47, 122, 248, 0.32); background: rgba(47, 122, 248, 0.10); }
.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: 850; 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 rgba(20, 33, 61, 0.10);
  background: rgba(255, 255, 255, 0.82);
}
.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 rgba(20, 33, 61, 0.12);
  background: rgba(255,255,255,0.92);
  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); }
.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: rgba(47, 122, 248, 0.95); }
.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: 12px; border-top: 1px solid rgba(20, 33, 61, 0.10); display: flex; gap: 10px; align-items: flex-end; position: relative; }
.composer textarea { min-height: 44px; max-height: 180px; }
.dropZone {
  border: 2px dashed rgba(20, 33, 61, 0.22);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
}
.dropZone.dragover {
  border-color: rgba(47, 122, 248, 0.55);
  background: rgba(47, 122, 248, 0.10);
}
.fileRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(20, 33, 61, 0.10);
  background: rgba(255, 255, 255, 0.75);
  margin-top: 8px;
}
.fileRow .btn { padding: 6px 8px; border-radius: 10px; }
@media (max-width: 900px) {
  .messagesLayout { grid-template-columns: 1fr; }
  .messagesLeft { max-height: 360px; }
}
.reportLayout { display: grid; grid-template-columns: 360px 1fr; gap: 12px; margin-top: 12px; min-height: 560px; }
.reportLeft, .reportRight {
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadowSoft);
  overflow: hidden;
}
.reportLeft { display: flex; flex-direction: column; min-width: 0; }
.reportLeftTop { padding: 12px; border-bottom: 1px solid rgba(20, 33, 61, 0.10); }
.reportList { overflow: auto; flex: 1 1 auto; }
.reportItem { padding: 10px 12px; border-bottom: 1px solid rgba(20, 33, 61, 0.10); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.reportItem:hover { background: rgba(255, 255, 255, 0.90); }
.reportItem.active { background: rgba(47, 122, 248, 0.10); }
.reportRight { display: flex; flex-direction: column; min-width: 0; }
.reportHeader { padding: 12px; border-bottom: 1px solid rgba(20, 33, 61, 0.10); }
.reportHeaderTitle { font-weight: 950; }
.reportHeaderSub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.reportDetail { padding: 12px; overflow: auto; flex: 1 1 auto; background: rgba(255, 255, 255, 0.55); }
.segRow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.segBtn {
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: default;
  min-width: 120px;
  text-align: center;
  font-weight: 800;
}
.segBtn.active { border-color: rgba(18, 184, 134, 0.45); background: rgba(18, 184, 134, 0.12); }
.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); }
.fieldBox { border: 1px solid rgba(20, 33, 61, 0.12); background: rgba(255, 255, 255, 0.80); border-radius: 14px; padding: 10px 12px; }
.attachmentsRow { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.attCard { border: 1px solid rgba(20, 33, 61, 0.12); background: rgba(255, 255, 255, 0.86); border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.attIcon { width: 32px; height: 32px; border-radius: 12px; border: 1px solid rgba(20, 33, 61, 0.12); background: rgba(47, 122, 248, 0.10); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: rgba(20, 33, 61, 0.75); }
.attName { font-weight: 900; }
.attSub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.attLink { font-size: 12px; color: rgba(11, 42, 109, 0.95); text-decoration: underline; word-break: break-all; }
@media (max-width: 900px) {
  .reportLayout { grid-template-columns: 1fr; }
  .reportLeft { max-height: 360px; }
}
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal {
  width: 100%;
  max-width: 720px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}
.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.10);
  z-index: 1;
}
.modalHeader h3 { margin: 0; }
.modalBody {
  overflow: auto;
  min-height: 0;
}
.actionsRow { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .modalBackdrop { align-items: flex-start; }
  .modal { margin: 16px 0; }
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  align-items: start;
}
.content { min-width: 0; }
.sidebar {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadowSoft);
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 94px);
  overflow: auto;
}
.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebarTitle {
  font-weight: 850;
  color: rgba(20, 33, 61, 0.58);
  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 rgba(20, 33, 61, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.06);
}
.menuItem:hover {
  border-color: rgba(47, 122, 248, 0.40);
  background: linear-gradient(90deg, rgba(47, 122, 248, 0.10), rgba(123, 92, 255, 0.08), rgba(255, 77, 141, 0.06));
}
.menuItem.active {
  border-color: rgba(47, 122, 248, 0.45);
  background: linear-gradient(90deg, rgba(47, 122, 248, 0.16), rgba(123, 92, 255, 0.12), rgba(255, 77, 141, 0.10));
}
.menuIcon {
  width: 24px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.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; }

.sidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 30;
}

@media (max-width: 900px) {
  .wrap { padding: 14px; }
  .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; }
}

.loginHero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.loginMark {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(47, 122, 248, 0.16), rgba(123, 92, 255, 0.12), rgba(255, 77, 141, 0.10));
}
.loginMark .icon { width: 22px; height: 22px; }
.inputGroup {
  position: relative;
}
.inputRightBtn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 8px 10px;
  border-radius: 14px;
}
.btn.inputRightBtn:hover {
  transform: translateY(-50%);
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.06);
}
.inputHasRightBtn input {
  padding-right: 70px;
}
