:root {
  --blue: #003a6e;
  --blue-2: #005aa0;
  --blue-3: #0874bf;
  --orange: #e84422;
  --orange-2: #f0442f;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --border: #e4e9ef;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --brand-gradient: linear-gradient(135deg, #003a6e 0%, #005aa0 52%, #e84422 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(0, 58, 110, 0.12), rgba(0, 90, 160, 0.09), rgba(232, 68, 34, 0.12));
  --shadow: 0 14px 34px rgba(0, 58, 110, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(0, 58, 110, 0.09) 0, rgba(0, 90, 160, 0.05) 260px, var(--bg) 520px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px rgba(0, 90, 160, 0.14);
}

textarea {
  resize: vertical;
}

label {
  color: #26364a;
  font-size: 13px;
  font-weight: 850;
}

.btn {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #eef3f8;
  color: var(--blue);
  font-weight: 850;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 10px 18px rgba(0, 90, 160, 0.22);
}

.btn.secondary,
.btn.send {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: 0 10px 18px rgba(232, 68, 34, 0.22);
}

.btn.danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn.danger:hover {
  background: #fecaca;
}

.btn.subtle {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue);
}

.btn.light {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.17);
  color: #fff;
}

.btn.full {
  width: 100%;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(0, 58, 110, 0.97), rgba(0, 90, 160, 0.9) 55%, rgba(232, 68, 34, 0.92)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 22px);
}

.login-card {
  width: min(640px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 27, 52, 0.28);
  padding: 34px;
  border-top: 6px solid var(--orange);
}

.login-logo {
  width: min(540px, 100%);
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.login-logo-frame {
  border: 1px solid rgba(0, 58, 110, 0.12);
  border-radius: 14px;
  margin: 0 0 24px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 254, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 34px rgba(0, 58, 110, 0.13);
}

.login-card h1 {
  margin: 0;
  color: var(--blue);
  font-size: 30px;
}

.login-card p,
.form-title p,
.main-title p,
.chat-head p,
.login-note {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-form,
.task-form,
.user-form {
  display: grid;
  gap: 12px;
}

.login-form {
  margin-top: 26px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.app-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 22px;
  border-bottom: 0;
  background:
    var(--brand-gradient),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 24px);
  color: #fff;
  box-shadow: 0 14px 38px rgba(0, 58, 110, 0.24);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 16px;
  padding: 8px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 254, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 34px rgba(0, 27, 52, 0.22);
  backdrop-filter: blur(10px);
}

.header-logo {
  display: block;
  width: clamp(320px, 38vw, 650px);
  height: auto;
  max-height: 72px;
  max-width: 52vw;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 6px 12px rgba(0, 58, 110, 0.16));
}

.header-copy {
  display: none;
  min-width: 0;
}

.header-brand h1 {
  margin: 0;
  color: #fff;
  font-size: 27px;
  line-height: 1;
}

.header-brand p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.session-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 12px;
}

.header-refresh {
  white-space: nowrap;
}

.header-training {
  white-space: nowrap;
}

.mobile-label {
  display: none;
}

.session-avatar,
.chat-avatar,
.user-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.session-avatar {
  background: #fff;
  color: var(--blue);
}

.session-box strong,
.session-box span,
.session-box small {
  display: block;
}

.session-box span,
.session-box small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  text-transform: capitalize;
}

.layout-shell {
  max-width: none;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.dashboard-aside {
  display: grid;
  align-content: start;
  gap: 16px;
}

.side-card,
.brand-card,
.tabs,
.main-title,
.users-panel,
.chat-panel,
.task-helper,
.task-form,
.task-lane,
.notification-list,
.user-form,
.admin-list-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.side-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.side-card h2 {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 19px;
}

.side-card.emphasis {
  border: 0;
  background: var(--brand-gradient);
  color: #fff;
}

.side-card.emphasis p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.side-card.emphasis h2 {
  color: #fff;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats article {
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #f8fbfe);
  padding: 14px;
  border-top: 3px solid var(--blue-2);
}

.stats strong {
  display: block;
  color: var(--blue);
  font-size: 27px;
  line-height: 1;
}

.stats article:nth-child(2n) {
  border-top-color: var(--orange);
}

.stats article:nth-child(2n) strong {
  color: var(--orange);
}

.stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.brand-card {
  padding: 12px;
  background: #fff;
  border-top: 4px solid var(--orange);
}

.brand-card img {
  display: block;
  width: 100%;
  height: auto;
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 142px);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 8px;
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, #fff, #f8fbfe);
  border-top: 3px solid var(--blue-2);
}

.tab {
  min-height: 40px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #334155;
  font-weight: 850;
  white-space: nowrap;
  padding: 0 12px;
}

.tab.active {
  border-color: transparent;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 12px 22px rgba(0, 58, 110, 0.2);
}

.pill {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  background: #e8f0f7;
  color: inherit;
  font-size: 12px;
}

.tab.active .pill {
  background: rgba(255, 255, 255, 0.2);
}

.pill.accent {
  background: var(--orange);
  color: #fff;
}

.main-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 0;
  background: var(--brand-gradient);
  color: #fff;
}

.main-title h2 {
  margin: 0;
  color: #fff;
  font-size: 21px;
}

.main-title p {
  color: rgba(255, 255, 255, 0.84);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

#messagesPanel.active {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.users-panel {
  padding: 14px;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: #f8fbfe;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.panel-heading,
.lane-heading,
.task-card-header,
.section-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h3,
.lane-heading h3,
.task-helper h3,
.chat-head h3,
.form-title h3 {
  margin: 0;
  color: var(--blue);
  font-size: 19px;
}

.panel-heading span,
.lane-heading span {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef6ff;
  color: var(--blue);
  font-weight: 900;
}

.search-input {
  margin: 12px 0;
}

.user-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.user-row {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  background: #fff;
  text-align: left;
  min-width: 0;
}

.chat-row {
  min-height: 72px;
}

.user-row:hover,
.user-row.active {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #fff7ed);
}

.user-row.unread {
  border-color: rgba(232, 68, 34, 0.42);
  background:
    linear-gradient(135deg, rgba(232, 68, 34, 0.11), rgba(239, 246, 255, 0.98));
}

.user-row.unread strong {
  color: var(--blue);
}

.unread-chat-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.user-row strong,
.user-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row small,
.user-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.chat-copy small {
  max-width: 100%;
}

.group-avatar {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.type-chip {
  min-height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #ffebe7;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
}

.user-presence {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 58px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9ca3af;
}

.status-dot.online {
  background: #22c55e;
}

.chat-panel {
  min-width: 0;
  display: grid;
  height: auto;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.chat-head {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 0;
  background:
    linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
}

.chat-back {
  display: none;
}

.chat-head-copy {
  min-width: 0;
}

.chat-head-copy h3,
.chat-head-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head h3 {
  color: #fff;
}

.chat-head p {
  color: rgba(255, 255, 255, 0.82);
}

.chat-head .chat-avatar {
  background: #fff;
  color: var(--blue);
}

.chat-admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.message-list {
  overflow-y: auto;
  min-height: 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(0, 58, 110, 0.045), rgba(232, 68, 34, 0.035)),
    repeating-linear-gradient(45deg, rgba(0, 58, 110, 0.045) 0 1px, transparent 1px 24px),
    #f8fbfe;
}

.message-bubble {
  max-width: min(760px, 72%);
  min-width: 0;
  border-radius: 12px;
  padding: 12px 13px 9px;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
  line-height: 1.45;
}

.message-bubble.mine {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
  color: #fff;
}

.message-bubble.theirs {
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  background: #fff;
}

.message-bubble.unread-message {
  outline: 2px solid rgba(232, 68, 34, 0.28);
  box-shadow: 0 8px 22px rgba(232, 68, 34, 0.13);
}

.message-bubble.message-focus {
  animation: message-focus 1.2s ease;
}

@keyframes message-focus {
  0%, 100% { box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08); }
  35% { box-shadow: 0 0 0 4px rgba(232, 68, 34, 0.2), 0 10px 24px rgba(232, 68, 34, 0.18); }
}

.message-bubble p {
  margin: 0 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-reply-quote,
.reply-preview {
  border: 0;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
  background: rgba(0, 58, 110, 0.08);
  color: inherit;
}

.message-reply-quote {
  width: 100%;
  margin: 0 0 8px;
  cursor: pointer;
}

.message-bubble.mine .message-reply-quote {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #fff;
}

.message-reply-quote strong,
.message-reply-quote span,
.reply-preview strong,
.reply-preview span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reply-quote strong,
.reply-preview strong {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.message-bubble.mine .message-reply-quote strong {
  color: #fff;
}

.message-reply-quote span,
.reply-preview span {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.84;
}

.message-attachments {
  display: grid;
  gap: 7px;
  margin: 8px 0;
}

.attachment-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  width: min(330px, 100%);
  border-radius: 9px;
  padding: 8px 10px;
  text-decoration: none;
  border: 1px solid rgba(0, 58, 110, 0.15);
  background: rgba(255, 255, 255, 0.82);
  color: var(--blue);
}

.message-bubble.mine .attachment-chip {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.attachment-icon {
  width: 42px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.attachment-chip strong,
.attachment-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip small {
  margin-top: 2px;
  opacity: 0.76;
  font-size: 12px;
}

.message-sender {
  display: block;
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 12px;
}

.message-bubble footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.message-bubble.mine footer {
  color: rgba(255, 255, 255, 0.78);
}

.message-badge {
  min-height: 21px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  font-weight: 900;
}

.message-badge.muted {
  background: #64748b;
}

.message-badge.unread-badge {
  background: #fff1ed;
  color: var(--orange);
}

.message-action,
.message-delete {
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.message-action:hover {
  background: #dbeafe;
}

.message-delete {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.message-delete:hover {
  background: #fee2e2;
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-top: 1px solid #d8e3ee;
  background: linear-gradient(180deg, #fff, #f7fbff);
  min-width: 0;
}

.reply-preview {
  grid-column: 1 / -1;
  align-items: center;
  background: #fff7f4;
  color: var(--text);
}

.reply-preview[hidden] {
  display: none;
}

.reply-cancel {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(232, 68, 34, 0.12);
  color: var(--orange);
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attach-button {
  width: 48px;
  min-height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #e8f0f7;
  color: var(--blue);
  font-size: 26px;
  font-weight: 900;
}

.attachment-preview {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-height: 92px;
  overflow-y: auto;
  padding-right: 2px;
}

.attachment-preview[hidden] {
  display: none;
}

.selected-file {
  max-width: min(260px, 100%);
  border: 1px solid #d8e3ee;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
}

.selected-file strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file small {
  color: var(--muted);
  flex: 0 0 auto;
}

.composer textarea {
  min-height: 54px;
  max-height: 140px;
  border-radius: 10px;
  resize: none;
  overflow-y: auto;
  min-width: 0;
}

.task-helper {
  display: none;
  padding: 16px;
  align-self: start;
}

.group-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.group-toggle {
  margin-top: 12px;
  border-color: rgba(0, 90, 160, 0.18);
  background:
    linear-gradient(180deg, #fff, #f8fbfe);
  box-shadow: 0 8px 18px rgba(0, 58, 110, 0.08);
}

.group-toggle[aria-expanded="true"] {
  border-color: transparent;
  background: var(--brand-gradient);
  color: #fff;
}

.client-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #f8fbfe;
}

.client-form label {
  grid-column: 1 / -1;
}

.member-list {
  display: grid;
  max-height: 170px;
  overflow-y: auto;
  gap: 7px;
  margin-top: 8px;
  padding-right: 4px;
}

.member-list.compact {
  max-height: 210px;
}

.member-option {
  border: 1px solid #d8e3ee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #fff;
  font-size: 13px;
}

.member-option input {
  width: 16px;
  height: 16px;
}

.group-manage {
  display: grid;
  gap: 10px;
}

.group-manage[hidden] {
  display: none;
}

.helper-box,
.helper-example {
  margin-top: 12px;
  border-radius: 8px;
  padding: 14px;
}

.helper-box {
  border: 1px solid #d8e3ee;
  background: #f8fbfe;
  color: #173a60;
}

.helper-box.primary {
  border-color: transparent;
  background: var(--brand-gradient);
  color: #fff;
}

.helper-box.primary p {
  color: rgba(255, 255, 255, 0.88);
}

.helper-box p,
.helper-example p {
  margin: 7px 0 0;
  line-height: 1.45;
}

.helper-example {
  border: 1px solid rgba(232, 68, 34, 0.2);
  background: #fff7ed;
  color: #8a3414;
}

.helper-example span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.task-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #fff;
}

.task-filter-bar label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-filter-bar select {
  min-width: min(260px, 100%);
}

.task-lane {
  padding: 16px;
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.task-card {
  border: 1px solid var(--border);
  border-left: 6px solid var(--orange);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  padding: 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.task-card.done {
  border-left-color: var(--green);
  background: linear-gradient(180deg, #fff, #f3fff8);
}

.task-card.archived {
  border-left-color: #94a3b8;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.task-card-header {
  align-items: flex-start;
}

.task-card-header strong {
  color: #172033;
  font-size: 17px;
  line-height: 1.25;
}

.task-card p {
  margin: 10px 0;
  color: #475569;
  overflow-wrap: anywhere;
  line-height: 1.48;
}

.priority,
.status-chip,
.role-chip,
.client-chip {
  min-height: 25px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: #e8f0f7;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-chip {
  width: fit-content;
  margin: 8px 0 0;
  background: #eff6ff;
  color: var(--blue);
}

.priority.alta,
.priority.urgente {
  background: #ffebe7;
  color: var(--orange);
}

.priority.baja,
.status-chip.done {
  background: #dcfce7;
  color: #166534;
}

.status-chip.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-chip.archived {
  background: #e2e8f0;
  color: #334155;
}

.task-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
}

.task-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.task-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.task-edit-form,
.task-reminder-form,
.task-transfer-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #f8fbfe;
}

.task-edit-form label,
.task-reminder-form label,
.task-transfer-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-edit-form select,
.task-edit-form input,
.task-reminder-form select,
.task-reminder-form input,
.task-transfer-form select,
.task-transfer-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  font-size: 13px;
  text-transform: none;
}

.task-edit-form .btn,
.task-reminder-form .btn,
.task-transfer-form .btn {
  min-width: 0;
  white-space: nowrap;
}

.task-reminder-form small {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 20, 38, 0.42);
  backdrop-filter: blur(8px);
}

.task-modal[hidden] {
  display: none;
}

.task-modal-card {
  width: min(860px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.task-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  color: #fff;
  background: var(--brand-gradient);
}

.task-modal-head h3 {
  margin: 8px 0 4px;
  font-size: 24px;
  line-height: 1.2;
}

.task-modal-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.task-modal-head .client-chip {
  margin: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.task-detail-body,
.task-activity,
.task-update-form {
  padding: 16px 20px;
}

.task-detail-body {
  border-bottom: 1px solid var(--border);
}

.task-detail-body p,
.task-update p {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.muted-copy {
  color: var(--muted) !important;
}

.task-activity {
  min-height: 0;
  overflow-y: auto;
}

.task-activity h4 {
  margin: 0 0 12px;
  color: var(--blue);
}

.task-update-list {
  display: grid;
  gap: 10px;
}

.task-update {
  border: 1px solid #dce5ee;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfe;
}

.task-update header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.task-update header strong {
  color: #172033;
}

.task-update-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.task-update-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-update-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.attach-button.small {
  width: 42px;
  min-height: 42px;
  font-size: 22px;
}

.push-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #dce5ee;
  border-left: 6px solid var(--blue-2);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbfe);
}

.push-card strong {
  color: var(--blue);
}

.push-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.push-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.form-title {
  grid-column: 1 / -1;
}

.form-title h3 {
  margin: 0;
}

.task-form .wide {
  grid-column: span 3;
}

.task-form button {
  align-self: end;
}

.section-action {
  justify-content: flex-end;
  margin-bottom: 14px;
}

.notification-list,
.admin-list-card {
  padding: 14px;
}

.notification-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.notification,
.admin-user {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 12px;
}

.notification {
  grid-template-columns: 1fr auto;
}

.notification.unread {
  border-color: rgba(232, 68, 34, 0.46);
  background:
    linear-gradient(90deg, rgba(232, 68, 34, 0.11), rgba(255, 255, 255, 0.92));
}

.notification strong {
  color: var(--blue);
  text-transform: capitalize;
}

.notification p,
.notification span {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-layout .admin-list-card {
  grid-column: 2;
}

.user-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  grid-row: span 2;
}

.admin-user {
  grid-template-columns: 44px minmax(180px, 1fr) minmax(150px, max-content) minmax(220px, auto);
}

.admin-user.inactive {
  opacity: 0.64;
}

.admin-user strong,
.admin-user span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.summary-chip {
  border-radius: 999px;
  padding: 5px 9px;
  color: #667085;
  background: #f2f5f8;
  border: 1px solid #dce5ee;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-chip.enabled {
  color: #157347;
  background: #f0fbf6;
  border-color: #bde4d0;
}

.admin-user small {
  color: var(--muted);
}

.admin-actions,
.admin-tool-actions,
.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tool-actions {
  margin-top: 12px;
  align-items: stretch;
}

.admin-tool-actions .btn {
  min-width: min(230px, 100%);
}

.admin-actions {
  justify-content: flex-end;
}

.admin-actions .btn {
  min-width: 0;
}

.summary-times-input {
  width: min(170px, 100%);
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.suggestion-card {
  align-items: stretch;
}

.suggestion-admin-form {
  min-width: min(320px, 100%);
  display: grid;
  gap: 8px;
}

.suggestion-admin-form textarea {
  min-height: 64px;
  resize: vertical;
}

.admin-actions .btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.form-help,
.admin-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-note {
  margin: 0 0 12px;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--orange));
}

.client-admin-row .role-chip {
  background: #fff7f4;
  color: var(--orange);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
}

.empty.compact {
  padding: 10px;
  font-size: 13px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
}

.toast {
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}

.toast.success {
  background: var(--green);
}

.toast.warning {
  background: var(--amber);
}

.toast.error {
  background: var(--red);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.assistant-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  justify-items: end;
  gap: 10px;
}

@media (min-width: 861px) {
  body:has(#messagesPanel.active) .assistant-widget {
    right: 24px;
    bottom: 96px;
  }
}

.assistant-toggle {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(0, 58, 110, 0.28);
}

.assistant-toggle::before {
  content: "?";
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
}

.assistant-panel {
  width: min(390px, calc(100vw - 36px));
  border: 1px solid rgba(0, 58, 110, 0.16);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 27, 52, 0.24);
}

.assistant-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: var(--brand-gradient);
  color: #fff;
}

.assistant-panel header strong,
.assistant-panel header span {
  display: block;
}

.assistant-panel header span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.assistant-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.assistant-messages {
  max-height: min(380px, 48vh);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #f8fbfe, #fff);
}

.assistant-message {
  max-width: 88%;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-line;
}

.assistant-message.assistant {
  justify-self: start;
  border: 1px solid var(--border);
  background: #fff;
  color: #26364a;
}

.assistant-message.user {
  justify-self: end;
  background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
  color: #fff;
}

.assistant-suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 14px 12px;
  background: #fff;
}

.assistant-suggestions button {
  border: 1px solid #d8e3ee;
  border-radius: 999px;
  flex: 0 0 auto;
  padding: 7px 10px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.assistant-suggestions button.assistant-command-only {
  border-color: rgba(232, 68, 34, 0.28);
  color: var(--orange);
  background: #fff7f4;
}

.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.assistant-form input {
  min-height: 40px;
}

@media (max-width: 1500px) and (min-width: 861px) {
  #messagesPanel.active {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  #messagesPanel.active .task-helper {
    display: none;
  }
}

@media (max-width: 1240px) {
  .layout-shell,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .task-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #messagesPanel.active {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  #messagesPanel.active .task-helper {
    display: none;
  }

  .admin-layout .admin-list-card,
  .user-form {
    grid-column: auto;
    grid-row: auto;
  }

  .dashboard-aside {
    grid-template-columns: 1fr 1fr;
  }

  .brand-card {
    display: none;
  }
}

@media (max-width: 980px) {
  .admin-user {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .admin-meta-chips,
  .admin-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .admin-tool-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-tool-actions .btn {
    width: 100%;
  }
}

@media (max-width: 860px) {
  body {
    min-height: 100dvh;
  }

  .app-header {
    min-height: 72px;
    padding: 10px 12px;
    gap: 12px;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 25;
  }

  .header-logo {
    width: 136px;
    height: auto;
    max-height: 46px;
    max-width: 34vw;
    padding: 0;
  }

  .brand-mark {
    border-radius: 12px;
    padding: 5px 7px;
    box-shadow: 0 10px 22px rgba(0, 27, 52, 0.18);
  }

  .header-brand h1,
  .header-brand p,
  .session-box div:not(.session-avatar) {
    display: none;
  }

  .session-box {
    gap: 5px;
    padding: 6px;
    flex: 0 0 auto;
  }

  .session-box .btn {
    min-height: 34px;
    padding: 6px 7px;
    font-size: 11px;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .session-avatar {
    width: 38px;
    height: 38px;
  }

  .layout-shell {
    display: block;
    padding: 10px 10px 112px;
  }

  .main-area {
    display: block;
    height: auto;
  }

  .dashboard-aside {
    display: none;
  }

  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 7px;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 28px rgba(0, 58, 110, 0.14);
  }

  .tab {
    min-width: 0;
    min-height: 36px;
    padding: 0 6px;
    font-size: 11px;
  }

  .tab .pill {
    display: none;
  }

  .main-title {
    margin: 10px 0;
    padding: 12px 14px;
  }

  .main-title h2 {
    font-size: 20px;
  }

  .main-title p {
    display: none;
  }

  body.is-chat-open .tabs,
  body.is-chat-open .main-title {
    display: none;
  }

  body.is-chat-open .layout-shell {
    padding-bottom: 10px;
  }

  #messagesPanel.active {
    display: block;
    min-height: calc(100dvh - 176px);
  }

  body.is-chat-open #messagesPanel.active {
    min-height: calc(100dvh - 98px);
  }

  #messagesPanel.active:not(.chat-open) .chat-panel {
    display: none;
  }

  #messagesPanel.active.chat-open .users-panel {
    display: none;
  }

  .users-panel {
    min-height: calc(100dvh - 184px);
    padding: 12px;
  }

  .user-list {
    max-height: calc(100dvh - 270px);
    overflow-y: auto;
    padding-bottom: 8px;
  }

  .chat-row {
    min-height: 74px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    padding: 10px;
  }

  .chat-panel {
    height: calc(100dvh - 176px - env(safe-area-inset-bottom));
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 8px;
  }

  body.is-chat-open .chat-panel {
    height: calc(100dvh - 98px - env(safe-area-inset-bottom));
  }

  .chat-head {
    min-height: 64px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 12px;
  }

  .chat-back {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 31px;
    line-height: 1;
  }

  .chat-head .chat-avatar {
    width: 38px;
    height: 38px;
  }

  .chat-head-copy {
    flex: 1 1 auto;
  }

  .chat-head-copy h3 {
    font-size: 16px;
  }

  .chat-head-copy p {
    font-size: 12px;
  }

  .chat-admin-actions {
    width: auto;
    max-width: 112px;
    justify-content: flex-end;
  }

  .chat-admin-actions .btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .message-list {
    padding: 12px 10px;
    gap: 8px;
  }

  .message-bubble {
    max-width: 88%;
    padding: 10px 11px 8px;
  }

  .composer,
  .task-board,
  .task-form,
  .client-form {
    grid-template-columns: 1fr;
  }

  .task-filter-bar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-filter-bar select {
    width: 100%;
  }

  .task-form .wide {
    grid-column: span 1;
  }

  .btn.send {
    width: auto;
    min-height: 46px;
    padding-inline: 16px;
  }

  .composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .attach-button {
    width: 46px;
    min-height: 46px;
    font-size: 24px;
  }

  .composer textarea {
    min-height: 46px;
    max-height: 110px;
    padding: 11px 12px;
  }

  .task-board {
    gap: 12px;
  }

  .task-lane,
  .task-form,
  .notification-list,
  .user-form,
  .admin-list-card {
    padding: 12px;
  }

  .task-card {
    padding: 13px;
  }

  .task-card footer {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-card footer .btn {
    width: 100%;
  }

  .task-edit-form,
  .task-reminder-form,
  .task-transfer-form {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .task-modal {
    align-items: stretch;
    padding: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .task-modal-card {
    max-height: calc(100vh - 16px - env(safe-area-inset-bottom));
    border-radius: 10px;
  }

  .task-modal-head {
    padding: 16px;
  }

  .task-modal-head h3 {
    font-size: 20px;
  }

  .task-detail-body,
  .task-activity,
  .task-update-form {
    padding: 13px;
  }

  .task-update-actions {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .task-update-actions .btn {
    width: 100%;
  }

  .push-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .push-actions {
    justify-content: stretch;
  }

  .push-actions .btn,
  .task-edit-form .btn,
  .task-reminder-form .btn,
  .task-transfer-form .btn,
  .summary-times-input {
    width: 100%;
  }

  .assistant-widget {
    right: auto;
    left: 12px;
    bottom: calc(106px + env(safe-area-inset-bottom));
    justify-items: start;
    z-index: 28;
  }

  .assistant-widget.open {
    left: 8px;
    right: 8px;
    bottom: calc(106px + env(safe-area-inset-bottom));
    z-index: 70;
    justify-items: stretch;
  }

  .assistant-toggle {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0;
    box-shadow: 0 10px 24px rgba(0, 58, 110, 0.22);
  }

  .assistant-toggle::before {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .assistant-panel {
    width: min(420px, calc(100vw - 16px));
    max-height: min(70dvh, 560px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .assistant-messages {
    max-height: none;
  }

  body.is-chat-open .assistant-widget:not(.open),
  body:has(#messagesPanel.active.chat-open) .assistant-widget:not(.open) {
    display: none;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 24px;
  }

  .login-card h1 {
    font-size: 25px;
  }

  .chat-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .chat-head .chat-avatar {
    display: none;
  }

  .chat-admin-actions {
    max-width: 42px;
  }

  .chat-admin-actions .btn {
    width: 38px;
    min-width: 38px;
    padding: 0;
    font-size: 0;
  }

  .chat-admin-actions .btn::before {
    content: "\00d7";
    font-size: 19px;
    line-height: 1;
  }

  .message-bubble {
    max-width: 94%;
  }

  .composer {
    grid-template-columns: 42px minmax(0, 1fr) 68px;
    gap: 7px;
  }

  .attach-button {
    width: 42px;
    min-height: 42px;
  }

  .composer textarea {
    min-height: 42px;
    padding: 9px 10px;
  }

  .btn.send {
    min-height: 42px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .task-meta,
  .notification,
  .admin-user {
    grid-template-columns: 1fr;
  }

  .admin-meta-chips {
    justify-content: flex-start;
  }

  .admin-actions .btn {
    width: 100%;
  }
}
