#v2-inbox.v2-tool-pane.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--v2-bg-page, #f4f6f8);
}

.v2-inbox {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  flex: 1;
  min-height: 0;
  margin: 16px 20px 20px;
  background: var(--v2-bg-card, #fff);
  border: 1px solid var(--v2-border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.v2-inbox-list {
  border-right: 1px solid var(--v2-border-color, #e5e7eb);
  display: flex;
  flex-direction: column;
}

.v2-inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-bottom: 1px solid var(--v2-border-color, #e2e8f0);
}

.v2-inbox-toolbar-left,
.v2-inbox-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.v2-inbox-toggles {
  display: inline-flex;
  padding: 3px;
  background: #e8eef5;
  border-radius: 8px;
}

.v2-inbox-toggles button {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.v2-inbox-toggles button.is-on {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.v2-inbox-select,
.v2-inbox-org {
  font-size: 13px;
  color: #334155;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 6px 10px;
}

.v2-inbox-org-label {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  padding: 4px 10px;
}

.v2-inbox-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  margin: 0;
}

.v2-inbox-check input {
  margin: 0;
}

.v2-inbox-rows {
  overflow: auto;
  flex: 1;
}

.v2-inbox-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--v2-border-color, #e5e7eb);
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.v2-inbox-row:hover { background: #f8fafc; }
.v2-inbox-row.is-on { background: rgba(9, 100, 160, 0.08); }

.v2-inbox-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.v2-inbox-unread {
  background: #0964a0;
  color: #fff;
  border-radius: 10px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
}

.v2-inbox-row-meta,
.v2-inbox-preview,
.v2-inbox-compliance {
  font-size: 12px;
  color: var(--v2-text-secondary, #6b7280);
}

.v2-inbox-preview { margin-top: 4px; }
.v2-inbox-compliance { padding: 10px 14px; margin: 0; }

.v2-inbox-kind {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 8px;
  background: #e8f1f8;
  color: #0964a0;
}
.v2-inbox-kind.is-retail { background: #f1f5f9; color: #475569; }

.v2-inbox-ctx,
.v2-inbox-disc,
.v2-inbox-assigned {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
}

.v2-inbox-detail { display: flex; flex-direction: column; padding: 16px 20px; overflow: auto; }

.v2-inbox-thread-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.v2-inbox-thread-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.v2-inbox-thread-head h2 { margin: 0 0 4px; font-size: 1.1rem; }
.v2-inbox-thread-head p { margin: 0; font-size: 12px; color: var(--v2-text-secondary, #6b7280); }

.v2-inbox-bubble {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--v2-border-color, #e5e7eb);
  border-radius: 8px;
}

.v2-inbox-who { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.v2-inbox-who time { font-weight: 400; color: var(--v2-text-secondary, #6b7280); margin-left: 8px; }
.v2-inbox-sys { text-align: center; font-style: italic; color: var(--v2-text-secondary, #6b7280); margin: 10px 0; font-size: 12px; }
.v2-inbox-share { font-size: 13px; padding: 6px 0; }
.v2-inbox-composer { margin-top: 16px; }
.v2-inbox-composer textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.v2-inbox-composer-actions { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.v2-inbox-composer-actions .v2-btn-primary { margin-left: auto; }
.v2-inbox-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.v2-inbox-attach input { display: none; }
.v2-inbox-file-name { font-size: 12px; color: #475569; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-inbox-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.v2-inbox-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: #0964a0;
  cursor: pointer;
}
.v2-inbox-assign { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; margin: 0; }
.v2-inbox-assign select {
  font-size: 13px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  color: #0f172a;
}
.v2-inbox-note {
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
  color: #1e3a5f;
  background: #eef4f9;
  border-bottom: 1px solid #dbe3ee;
}
.v2-inbox-error { color: #dc2626; padding: 8px 12px; font-size: 13px; }
.v2-inbox-empty,
.v2-inbox-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  min-height: 220px;
  height: 100%;
  padding: 32px 24px;
  color: #64748b;
}
.v2-inbox-empty i,
.v2-inbox-placeholder i {
  font-size: 22px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.v2-inbox-empty p,
.v2-inbox-placeholder p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}
.v2-inbox-empty span,
.v2-inbox-placeholder span {
  font-size: 13px;
  max-width: 240px;
}

#v2-inbox-badge.v2-inbox-badge {
  position: relative;
  overflow: visible;
}
#v2-inbox-badge > i {
  font-size: 16px;
  line-height: 1;
  width: 16px;
  text-align: center;
}
#v2-inbox-badge .v2-inbox-badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  left: auto;
  bottom: auto;
  width: auto;
  height: 16px;
  min-width: 16px;
  max-width: 32px;
  margin: 0;
  padding: 0 4px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--v2-danger, #dc3545);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0;
  pointer-events: none;
  z-index: 2;
}

.v2-inbox-flyout {
  position: fixed;
  width: 340px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 80;
  overflow: hidden;
}

.v2-inbox-fly-head {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  color: #0f172a;
}

.v2-inbox-fly-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}

.v2-inbox-fly-list a:hover { background: #f8fafc; }

.v2-inbox-fly-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.v2-inbox-fly-list a strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.v2-inbox-fly-list a .v2-inbox-fly-meta,
.v2-inbox-fly-list a .v2-inbox-fly-preview {
  display: block;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-inbox-fly-list a .v2-inbox-fly-unread {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.v2-inbox-fly-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  color: #64748b;
  text-align: center;
}
.v2-inbox-fly-empty i { font-size: 18px; color: #94a3b8; }
.v2-inbox-fly-empty p { margin: 0; font-size: 13px; }

.v2-inbox-fly-all {
  display: block;
  padding: 11px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #0964a0;
  text-decoration: none;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.v2-inbox-fly-all:hover { background: #eef4f9; }

.v2-compose-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-compose-card {
  background: #fff;
  width: min(520px, 92vw);
  border-radius: 10px;
  padding: 20px 22px;
}

.v2-compose-card header { display: flex; justify-content: space-between; align-items: center; }
.v2-compose-card h2 { margin: 0; font-size: 1.1rem; }
.v2-compose-card label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 13px; font-weight: 600; }
.v2-compose-card input:not([type="radio"]),
.v2-compose-card textarea { width: 100%; box-sizing: border-box; }
.v2-compose-disc { border: 0; padding: 0; margin: 4px 0 12px; }
.v2-compose-disc legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.v2-compose-disc label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-weight: 400;
}
.v2-compose-disc input { width: auto; margin: 0; flex: none; }
.v2-compose-note { font-size: 12px; color: #6b7280; }
.v2-compose-actions { display: flex; justify-content: flex-end; gap: 8px; }
.v2-compose-err { color: #dc2626; margin-top: 8px; font-size: 13px; }
.v2-compose-x { border: 0; background: transparent; font-size: 22px; cursor: pointer; }

@media (max-width: 800px) {
  .v2-inbox { grid-template-columns: 1fr; margin: 12px; }
  .v2-inbox-list { border-right: 0; border-bottom: 1px solid var(--v2-border-color, #e5e7eb); max-height: 40vh; }
}

html.dark-theme #v2-inbox.v2-tool-pane.active,
.dark-theme #v2-inbox.v2-tool-pane.active { background: #0c111a; }
html.dark-theme .v2-inbox,
.dark-theme .v2-inbox {
  background: #151b27;
  border-color: #2a3444;
  box-shadow: none;
}
html.dark-theme .v2-inbox-toolbar,
.dark-theme .v2-inbox-toolbar,
html.dark-theme .v2-inbox-fly-head,
.dark-theme .v2-inbox-fly-head,
html.dark-theme .v2-inbox-fly-all,
.dark-theme .v2-inbox-fly-all { background: #1a2230; border-color: #2a3444; }
html.dark-theme .v2-inbox-toggles,
.dark-theme .v2-inbox-toggles { background: #0f1622; }
html.dark-theme .v2-inbox-toggles button,
.dark-theme .v2-inbox-toggles button { color: #cbd5e1; }
html.dark-theme .v2-inbox-toggles button.is-on,
.dark-theme .v2-inbox-toggles button.is-on { background: #243044; color: #f8fafc; }
html.dark-theme .v2-inbox-select,
html.dark-theme .v2-inbox-org,
html.dark-theme .v2-inbox-org-label,
.dark-theme .v2-inbox-select,
.dark-theme .v2-inbox-org,
.dark-theme .v2-inbox-org-label {
  background: #0f1622;
  color: #e6e9f0;
  border-color: #2a3444;
}
html.dark-theme .v2-inbox-check,
.dark-theme .v2-inbox-check,
html.dark-theme .v2-inbox-empty,
html.dark-theme .v2-inbox-placeholder,
.dark-theme .v2-inbox-empty,
.dark-theme .v2-inbox-placeholder { color: #94a3b8; }
html.dark-theme .v2-inbox-empty p,
html.dark-theme .v2-inbox-placeholder p,
html.dark-theme .v2-inbox-fly-head,
html.dark-theme .v2-inbox-fly-list a strong,
.dark-theme .v2-inbox-empty p,
.dark-theme .v2-inbox-placeholder p,
.dark-theme .v2-inbox-fly-head,
.dark-theme .v2-inbox-fly-list a strong { color: #e6e9f0; }
html.dark-theme .v2-inbox-row:hover,
html.dark-theme .v2-inbox-fly-list a:hover,
.dark-theme .v2-inbox-row:hover,
.dark-theme .v2-inbox-fly-list a:hover { background: #1c2636; }
html.dark-theme .v2-inbox-flyout,
.dark-theme .v2-inbox-flyout { background: #151b27; border-color: #2a3444; }
html.dark-theme .v2-inbox-composer textarea,
.dark-theme .v2-inbox-composer textarea,
html.dark-theme .v2-inbox-attach,
html.dark-theme .v2-inbox-assign select,
html.dark-theme .v2-inbox-file-link,
.dark-theme .v2-inbox-attach,
.dark-theme .v2-inbox-assign select,
.dark-theme .v2-inbox-file-link {
  background: #0f1622;
  color: #e6e9f0;
  border-color: #2a3444;
}
html.dark-theme .v2-inbox-note,
.dark-theme .v2-inbox-note {
  background: #1a2738;
  color: #dbe7f5;
  border-color: #2a3444;
}
