/* Standard analytics periods and responsive overview layout. */

/* Desktop: one compact segmented toolbar instead of a floating card. */
body.usynai-brand .dashboard-head .dashboard-period-area {
  flex: 1 1 680px;
  min-width: 560px;
  max-width: 860px;
  margin-left: clamp(20px, 3vw, 52px);
  align-self: center;
}

body.usynai-brand .dashboard-head > .marketplace-scope {
  margin-left: auto;
}

body.usynai-brand .overview-period-control {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px 11px;
}

body.usynai-brand .overview-period-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

body.usynai-brand .overview-period-label::before {
  content: '◷';
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
}

body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 6px 18px rgba(20, 24, 40, .06);
}

body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] button {
  min-width: 0;
  min-height: 38px;
  flex: 1 1 auto;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] button:hover:not(:disabled) {
  color: var(--ink);
  background: #f5f6fb;
}

body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] button.active,
body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 7px 16px rgba(91, 61, 255, .22);
}

body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] [data-period-custom] {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 13px;
  border-left: 1px solid var(--border);
  border-radius: 9px;
}

body.usynai-brand .overview-period-message {
  grid-column: 2;
  min-height: 0;
  margin: 0 2px;
  text-align: left;
}

body.usynai-brand .overview-period-message:empty {
  display: none;
}

@media (max-width: 1480px) and (min-width: 761px) {
  body.usynai-brand .dashboard-head .dashboard-period-area {
    order: 3;
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: 100%;
    margin: 4px 0 0;
  }

  body.usynai-brand .overview-period-control {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] button {
    min-height: 40px;
    font-size: 11px;
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] [data-period-custom] {
    grid-column: 1 / -1;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  /* The header badge and bottom Settings navigation already show this information. */
  body.usynai-brand.seller-overview-v2 #dashboard .dashboard-head > div:first-child,
  body.usynai-brand.seller-overview-v2 #dashboard #disconnect,
  body.usynai-brand.seller-overview-v2 #dashboardPeriodBar {
    display: none !important;
  }

  body.usynai-brand.seller-overview-v2 #dashboard .dashboard-head {
    gap: 0;
    margin-bottom: 14px;
  }

  body.usynai-brand.seller-overview-v2 #dashboard .dashboard-period-area {
    order: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  body.usynai-brand .overview-period-control {
    width: 100%;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.usynai-brand .overview-period-label {
    display: flex;
  }

  body.usynai-brand .overview-period-label::before {
    width: 26px;
    height: 26px;
  }

  body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] button {
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f7f8fc;
    font-size: 12px;
    white-space: normal;
  }

  body.usynai-brand .overview-period-presets[data-usyn-standard-presets="true"] [data-period-custom] {
    grid-column: 1 / -1;
    min-height: 42px;
    border-left: 1px solid var(--border);
  }

  body.usynai-brand .overview-period-message {
    grid-column: 1;
  }

  body.usynai-brand #dashboard > #warnings:empty {
    display: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.usynai-brand #dashboard > #warnings + #sellerAttention.daily-agenda {
    margin-top: 0;
  }
}
