/* MTM INDUS OS — responsive hardening shared by Admin, Team and Client.
   Keeps each portal's existing role-specific UI intact while preventing
   content from forcing the document wider than the device viewport. */
html, body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
body {
  overflow-x: hidden;
}
.app-main {
  width: calc(100% - var(--side-w, 262px));
  max-width: 100%;
  min-width: 0;
}
.view-host,
#view,
#view > *,
.view,
.view-content,
.page-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.view-host {
  overflow-x: clip;
}
.view-head,
.page-head,
.panel-head,
.toolbar,
.view-actions {
  min-width: 0;
  max-width: 100%;
}
.view-head,
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.view-head > *,
.page-head > * {
  min-width: 0;
  max-width: 100%;
}
.view-head h1,
.view-head h2,
.page-head h1,
.page-head h2,
#view h1,
#view h2,
#view h3,
#view h4 {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.view-head p,
.page-head p,
#view p {
  overflow-wrap: anywhere;
}
.view-actions,
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.metric-grid,
.feature-grid,
.chart-grid,
.stats-grid,
.card-grid,
.grid-2,
.grid-3,
.grid-4 {
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.metric-card,
.panel,
.card,
.panel-pad,
.chart-card {
  min-width: 0;
  max-width: 100%;
}
.panel,
.card,
.metric-card {
  overflow-wrap: anywhere;
}
.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  width: 100%;
}
canvas,
svg,
img,
video {
  max-width: 100%;
}
input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
}
@media (min-width: 1025px) {
  .app-main { width: calc(100% - var(--side-w, 262px)); }
}
@media (max-width: 1024px) {
  .app-main {
    width: 100%;
    margin-left: 0;
  }
}
@media (max-width: 640px) {
  .view-host { padding-inline: 12px; }
  .view,
  .view-content,
  .page-content { padding-inline: 0; }
  .view-head,
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .view-head h1,
  .page-head h1,
  #view > .view > h1 {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
    line-height: 1.12;
  }
  .view-head h2,
  .page-head h2,
  #view h2 {
    font-size: clamp(1.35rem, 5.8vw, 1.8rem);
    line-height: 1.2;
  }
  .view-actions,
  .toolbar {
    width: 100%;
  }
  .view-actions > *,
  .toolbar > button {
    flex: 0 0 auto;
  }
  .metric-grid,
  .feature-grid,
  .chart-grid,
  .stats-grid,
  .card-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric-card,
  .panel,
  .card { padding: 16px; }
  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .topbar {
    width: 100%;
    min-width: 0;
    gap: 10px;
    padding: 12px;
  }
  .topbar-title { flex: 1 1 auto; min-width: 0; }
  .topbar-title h1 { max-width: 100%; font-size: 1.15rem; }
  .topbar-actions { flex: 0 0 auto; gap: 6px; }
  .topbar-actions .btn { min-width: 40px; }
  .empty { padding: 28px 12px; }
}
@media (max-width: 380px) {
  .view-host { padding-inline: 8px; }
  .topbar { padding-inline: 8px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { padding-inline: 8px; }
}


/* Fix: notification dropdown must stay hidden until explicitly opened.
   The previous generic entrance animation used fill-mode: both, which kept
   the closed menu visually visible after its animation completed. */
.dropdown-menu {
  visibility: hidden;
  animation: none;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    visibility 0s linear var(--duration-fast);
}
.dropdown.open > .dropdown-menu {
  visibility: visible;
  animation: indus-menu-in var(--ui-motion-fast) var(--ease-out);
  transition-delay: 0s;
}
