@media (max-width: 1180px) {
  .oc-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oc-split { grid-template-columns: minmax(0, 1fr); }
  .oc-dashboard-metrics { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .oc-status-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .oc-status-strip h2 { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .oc-stage { margin-left: 0; }
  .oc-sidebar {
    translate: -105% 0;
    transition-property: translate;
    transition-duration: 180ms;
    transition-timing-function: ease-out;
  }
  .oc-menu-button,
  .oc-sidebar-close { display: inline-grid; }
  .oc-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, .32);
    opacity: 0;
    pointer-events: none;
    transition-property: opacity;
    transition-duration: 180ms;
    transition-timing-function: ease-out;
  }
  body.oc-sidebar-open { overflow: hidden; }
  body.oc-sidebar-open .oc-sidebar { translate: 0 0; }
  body.oc-sidebar-open .oc-sidebar-overlay { opacity: 1; pointer-events: auto; }
  .oc-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 64px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--oc-line);
    background: rgba(255, 255, 255, .98);
  }
  .oc-header #branding .oc-brand { display: inline-flex; }
  .oc-breadcrumbs { padding: 0 24px; }
  #content.oc-content { padding: 30px 24px 48px; }
  .oc-dashboard-charts { grid-template-columns: minmax(0, 1fr); }
  .oc-chart-panel { padding-right: 0; }
  .oc-chart-panel + .oc-chart-panel { padding-left: 0; border-top: 1px solid var(--oc-line); border-left: 0; }
}

@media (max-width: 720px) {
  .oc-dashboard-heading,
  .oc-dashboard-section-header { align-items: flex-start; flex-direction: column; }
  .oc-period-form { width: 100%; }
  .oc-period-date,
  .oc-period-select { flex: 1; }
  .oc-dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .oc-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .oc-header { min-height: 58px; gap: 8px; padding: 0 14px; }
  .oc-header-start,
  .oc-header-actions { gap: 4px; }
  .oc-header .oc-brand-copy,
  .oc-header-link,
  .oc-environment { display: none; }
  .oc-user-menu { height: 58px; }
  .oc-user-menu summary { min-width: 44px; min-height: 58px; padding: 0 8px; font-size: 0; }
  .oc-user-menu summary span { font-size: 13px; }
  .oc-breadcrumbs { min-height: 40px; overflow-x: auto; padding: 0 15px; white-space: nowrap; }
  #content.oc-content { padding: 26px 16px 40px; }
  .oc-page-heading { min-height: 78px; align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .oc-page-heading h1,
  #content h1 { font-size: 30px; }
  .oc-login-wrap { padding-inline: 14px; }
  .oc-login-card { padding: 25px 21px; }
  .oc-grid,
  .oc-grid--2,
  .oc-grid--3,
  .dashboard #content .oc-grid { grid-template-columns: minmax(0, 1fr); }
  .object-tools { position: static; display: flex; flex-wrap: wrap; margin: 0 0 14px !important; }
  .object-tools li { flex: 1; }
  .object-tools a { justify-content: center; }
  .change-form .object-tools { min-height: 40px; justify-content: flex-start; margin: -42px 0 28px !important; }
  .oc-data-tools { display: flex; align-items: stretch; flex-direction: column; }
  #toolbar { width: 100%; padding: 8px 12px; }
  #toolbar form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
  .oc-search-control { width: 100%; min-width: 0; grid-column: 1 / -1; }
  #toolbar form > button { min-width: 0; }
  .oc-data-tool-actions { width: 100%; min-height: 48px; align-items: stretch; }
  .oc-filter-menu { min-width: 0; flex: 1; border-left: 0; }
  .object-tools { min-width: 0; min-height: 48px; flex: 1; }
  .object-tools li,
  .object-tools a { width: 100%; min-width: 0; }
  .oc-filter-menu > summary { min-height: 44px; }
  .oc-filter-grid { position: fixed; inset: auto 14px 14px; width: auto; max-height: 72vh; grid-template-columns: minmax(0, 1fr); }
  .actions label { width: 100%; align-items: flex-start; flex-direction: column; }
  .actions select { width: 100%; min-width: 0; }
  .actions .action-counter { margin-left: 0; }
  .submit-row { position: static; display: grid; }
  .submit-row input,
  .submit-row a { width: 100%; }
  .oc-grid--metrics { gap: 24px; }
  .oc-stack { gap: 40px; }
  .oc-status-strip { grid-template-columns: minmax(0, 1fr); }
  .oc-status-item { min-height: 52px; }
  .oc-chart-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .oc-chart-bars { gap: 2px; }
  .oc-chart-label { display: none; }
}

@media (max-width: 420px) {
  .oc-dashboard-metrics { grid-template-columns: minmax(0, 1fr); }
  .oc-period-form { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
