/* mttgsupport — chrome on Metronic tokens. Only utilities missing from the prebuilt Tailwind bundle. */

:root {
  --font-stack-sans-serif: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-sans: var(--font-stack-sans-serif);
}

html,
body,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-stack-sans-serif);
}

main {
  flex: 1;
}

.min-h-0 { min-height: 0; }
.h-header { height: 3.5rem; }
.scroll-y { overflow: auto; }
.scroll-x { overflow-x: auto; }
.login-wrap { width: 100%; max-width: 28rem; }
.form-narrow { max-width: 36rem; }
.page-stack { display: flex; flex-direction: column; gap: 1.5rem; }

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.toolbar-filters > .kt-input,
.toolbar-filters > select.kt-input {
  width: auto;
  min-width: 9.5rem;
  max-width: 16rem;
}
.inbox-thread .toolbar-filters > .kt-input,
.inbox-thread .toolbar-filters > select.kt-input,
.inbox-thread .toolbar-filters > .send-compose {
  max-width: none;
}
.inbox-thread .toolbar-filters > .send-compose {
  flex: 1 1 8rem;
  min-width: 0;
}

.app-sidebar .kt-menu-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.app-sidebar .kt-menu-link:hover {
  background: var(--accent);
  color: var(--foreground);
}
.app-sidebar .kt-menu-item.here .kt-menu-link,
.app-sidebar .kt-menu-item.active .kt-menu-link {
  background: var(--accent);
  color: var(--foreground);
  font-weight: 600;
}
.app-sidebar .kt-menu-icon {
  display: inline-flex;
  width: 1.25rem;
  justify-content: center;
  color: inherit;
}
.app-sidebar .kt-menu-heading {
  padding: 1rem 0.75rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--foreground);
}
.metric-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.metric-sub {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.sidebar-backdrop { display: none; }
.profile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgb(0 0 0 / 0.4);
}
.profile-backdrop.is-open { display: block; }

.profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(20rem, 100vw);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  background: var(--background);
  border-left: 1px solid var(--border, var(--input));
  display: flex;
  flex-direction: column;
}
.profile-panel.is-open { transform: translateX(0); }

.profile-note {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, var(--input));
}
.profile-note-body {
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1023.98px) {
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    height: 100%;
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(0 0 0 / 0.4);
  }
}
@media (min-width: 1024px) {
  .app-sidebar {
    position: relative;
    transform: none !important;
  }
  .sidebar-backdrop { display: none !important; }
}

.inbox {
  display: flex;
  height: 100%;
  min-height: 0;
}
.inbox-list,
.inbox-thread {
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.inbox-list {
  width: 100%;
  border-right: 1px solid var(--border, var(--input));
}
.inbox-thread { flex: 1; position: relative; }
.chat-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.inbox-loading-overlay,
.inbox-loading-inline,
.inbox-loading-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.inbox-loading-overlay[hidden],
.inbox-loading-inline[hidden],
.inbox-loading-bar[hidden] {
  display: none !important;
}
.inbox-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  flex-direction: column;
  background: color-mix(in srgb, var(--background) 78%, transparent);
  backdrop-filter: blur(2px);
}
.inbox-loading-inline {
  padding: 0.85rem 0.75rem 1rem;
}
.inbox-loading-bar {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  border: 1px solid var(--border, var(--input));
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.08);
}
.inbox-spinner {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border: 2px solid var(--border, var(--input));
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: inbox-spin 0.7s linear infinite;
}
.inbox-spinner.is-lg {
  width: 1.75rem;
  height: 1.75rem;
  border-width: 2.5px;
}
@keyframes inbox-spin {
  to { transform: rotate(360deg); }
}
.dialog-row.is-active { background: var(--accent); }
.dialog-row:hover { background: var(--accent); }

.msg-row {
  display: flex;
  flex-direction: column;
}
.msg-row.in {
  align-items: flex-start;
}
.msg-row.out {
  align-items: flex-end;
}
.msg-row.in + .msg-row.in,
.msg-row.out + .msg-row.out {
  margin-top: 0.25rem;
}
.msg-row.system {
  align-items: center;
  margin: 0.35rem 0;
}
.msg-system {
  max-width: min(32rem, 92%);
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted-foreground);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-bubble {
  max-width: min(28rem, 85%);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem 0.35rem;
  font-size: 0.875rem;
  word-break: break-word;
  display: flex;
  flex-direction: column;
}
.msg-row.in .msg-bubble {
  background: var(--muted);
  color: var(--foreground);
}
.msg-row.out .msg-bubble {
  background: var(--primary);
  color: var(--primary-foreground);
}
.msg-bubble img {
  max-width: 220px;
  border-radius: 8px;
  display: block;
}
.msg-bubble.has-media {
  padding: 0.35rem;
}
.msg-caption {
  padding: 0.35rem 0.4rem 0.2rem;
}
.msg-media {
  position: relative;
  display: block;
  line-height: 0;
}
.msg-media img {
  max-width: min(220px, 70vw);
  border-radius: 8px;
  display: block;
}
.msg-media.is-loading {
  min-width: 8rem;
  min-height: 6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
}
.msg-media-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.35);
}
.msg-media.is-uploading img {
  filter: brightness(0.75);
}
.send-compose {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.send-compose-field {
  flex: 1;
  min-width: 0;
}
.kt-input:not(input) .kt-btn-primary,
.kt-input:not(input) .kt-btn-primary i {
  color: var(--primary-foreground);
}
.kt-input:not(input) #send-attach-btn.has-file,
.kt-input:not(input) #send-attach-btn.has-file i {
  color: var(--primary);
}
.send-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 10rem;
  padding: 0.15rem 0.35rem 0.15rem 0.2rem;
  border-radius: 9999px;
  border: 1px solid var(--border, var(--input));
  background: var(--accent);
  font-size: 0.75rem;
  min-width: 0;
}
.send-attach-chip img {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  object-fit: cover;
  flex-shrink: 0;
}
.send-attach-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.send-attach-clear {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
#send-attach-btn.has-file {
  color: var(--primary);
}
.send-btn-spinner {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}
.send-drop-hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--background) 55%, transparent);
  border: 2px dashed var(--primary);
  border-radius: 0.75rem;
}
.inbox-thread.is-drop-target .send-drop-hint {
  display: flex;
}
.inbox-toast {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  z-index: 7;
  transform: translateX(-50%);
  max-width: min(24rem, calc(100% - 1.5rem));
  padding: 0.45rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
  background: var(--background);
  border: 1px solid var(--border, var(--input));
}
.inbox-toast.is-ok {
  border-color: var(--success);
  color: var(--success);
}
.inbox-toast.is-err {
  border-color: var(--danger);
  color: var(--danger);
}
.inbox-toast[hidden] {
  display: none !important;
}
.action-flash {
  margin-top: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.35;
  border: 1px solid var(--border, var(--input));
}
.action-flash.is-ok {
  border-color: var(--success);
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}
.action-flash.is-err {
  border-color: var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.action-flash[hidden] {
  display: none !important;
}
.msg-meta {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 0.25rem;
}
.msg-row.in .msg-meta {
  color: var(--muted-foreground);
}
.msg-row.out .msg-meta {
  color: color-mix(in srgb, var(--primary-foreground) 72%, transparent);
}
.msg-row.system .msg-meta {
  align-self: center;
  opacity: 0.75;
}
.msg-meta.read {
  color: inherit;
}
.msg-meta.failed {
  color: var(--danger);
}
.msg-status-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.msg-row.out .msg-status-icon.is-delivered {
  color: color-mix(in srgb, var(--primary-foreground) 72%, transparent);
  opacity: 1;
}
.msg-row.out .msg-status-icon.is-read {
  color: #8ec8f8;
}
.msg-ticks-svg {
  display: block;
  width: 16px;
  height: 11px;
}
.msg-date-sep,
.msg-jump-bottom {
  z-index: 2;
  width: fit-content;
  max-width: 90%;
  border-radius: 9999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  border: 1px solid var(--border, var(--input));
  backdrop-filter: blur(4px);
}
.msg-date-sep {
  position: sticky;
  top: 0.35rem;
  margin: 0.35rem auto 0.45rem;
}
.msg-jump-bottom {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  z-index: 4;
  transform: translateX(-50%);
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 1.55rem;
  padding: 0.18rem 0.65rem;
  cursor: pointer;
  appearance: none;
  font: inherit;
  line-height: 1;
  user-select: none;
}
.msg-jump-bottom:hover {
  color: var(--foreground);
  background: color-mix(in srgb, var(--background) 92%, transparent);
}
.msg-jump-bottom[hidden] {
  display: none !important;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border: 1px solid var(--border, var(--input));
  color: var(--muted-foreground);
  text-decoration: none;
  white-space: nowrap;
}
.filter-chip.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.settings-nav-item {
  display: block;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.settings-nav-item.is-active {
  background: var(--accent);
  color: var(--foreground);
  font-weight: 600;
}

.settings-texts {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 1rem;
}
.settings-texts-save {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 0 -0.25rem;
  padding: 0.75rem 0.25rem;
  background: var(--background);
  border-top: 1px solid var(--input);
}
textarea[data-autosize] {
  field-sizing: content;
  min-height: 5.5rem;
  overflow-x: hidden;
  overflow-y: hidden;
  resize: vertical;
}

.dialog-badges {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (min-width: 1024px) {
  .inbox-list { width: 20rem; }
}
@media (min-width: 1280px) {
  .inbox-list { width: 24rem; }
}
